Embedded HTML using <PRE></PRE> and list numbers

  • Thread starter Thread starter Martin Dowie
  • Start date Start date
M

Martin Dowie

I have a large document which I have split into more managable smaller docs
that contain embedded HTML tags to get some nice formaing (bold, italics,
lists, etc).

The problem I have having is that there is some lines within <PRE></PRE>
tags nested in a list. For some reason Word2000 is adding each line as a
list item.

e.g. What I want is:

a) Foo
Some plain
text lines
in a fixed format
within <PRE></PRE>
b) Bar
c) Wibble

What I'm getting is:

a) Foo
b) Some plain
c) text lines
d) in a fixed format
e) within <PRE></PRE>
f) Bar
g) Wibble

Word97 does have this problem (just lots of others! ;-)

Can anyone help!

Cheers

-- Martin
 
G'day "Martin Dowie" <[email protected]>,

Write your own find and replace to deal with the code.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Martin Dowie reckoned:
 
Word Heretic said:
Write your own find and replace to deal with the code.

Sorry, I don't understand what you mean. I have lots of these
lists and they don't have fixed values to search for i.e. "a)" isn't
always "foo", "b)" isn't always "wibble".

-- Martin
 
From your description, it is not really clear what you are starting with.
That makes it very had to help you get what you want out of it.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Doug Robbins - Word MVP said:
From your description, it is not really clear what you are starting with.
That makes it very had to help you get what you want out of it.

ok, I'll try again :-)

I have a word document that is basically made up of only section header

1. Introduction
1.1 Scope
1.2 Definitions, etc

In each section there is a (link to) imported text file. The text file
happens to contain HTML tags and Word was informed that it is to treat the
file as HTML during the insertion of each file.

1. Introduction
<Introduction.html inserted here>
1.1 Scope
<Scope.html inserted here>
1.2 Definitions, etc
<Definitions.html inserted here>, etc

Within some of the .html file are lists (created using HTML tags) and
<PRE></PRE> sections, such that the format we used to get using Word97 gave
us the following (which is what we want):

a) Foo
Some lines
enclosed by '<PRE>' tags
to ensure the same format
is preserved. E.g. these strange looking lines.
b) Bar
c) Wibble

But, by default, Word2000 thinks that each line is another item in the list,
so gives:

a) Foo
b) Some lines
c) enclosed by '<PRE>' tags
d) to ensure the same format
e) is preserved. E.g. these strange looking lines.
f) Bar
g) Wibble

Is that clearer?

Cheers

-- Martin
 
For the part that gives you a problem, what does the "raw" HTML look like.
Please give a real example, not:

Some lines
enclosed by '<PRE>' tags
to ensure the same format
is preserved. E.g. these strange looking lines.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Doug Robbins - Word MVP said:
For the part that gives you a problem, what does the "raw" HTML look like.
Please give a real example, not:

<OL TYPE=a>
<LI><B>Control</B><BR>
Refer to Structure Chart.<BR>
<BR>
<LI><B>Algorithm</B><BR>
<PRE>
// Assign each byte of the input 32 bit value
// 31.. 24 | 23 .. 16 | 15 .. 8 | 7 .. 0
// Byte4 Byte 3 Byte 2 Byte 1
data_out : Uint8DataElement1 = (Uint8)(Float32DataElement & 0xFF)
data_out : Uint8DataElement2 = (Uint8)((Float32DataElement &gt;&gt; 8) &
0xFF)
data_out : Uint8DataElement3 = (Uint8)((Float32DataElement &gt;&gt; 16) &
0xFF)
data_out : Uint8DataElement4 = (Uint8)((Float32DataElement &gt;&gt; 24) &
0xFF)
</PRE><BR>
</OL>

The end of line is D:hex A:hex (LF/CR).

Cheers

-- Martin
 
<OL TYPE=a>
<LI><B>Control</B><BR>
Refer to Structure Chart.<BR>
<BR>
<LI><B>Algorithm</B><BR>
<PRE>
// Assign each byte of the input 32 bit value
// 31.. 24 | 23 .. 16 | 15 .. 8 | 7 .. 0
// Byte4 Byte 3 Byte 2 Byte 1
data_out : Uint8DataElement1 = (Uint8)(Float32DataElement & 0xFF)
data_out : Uint8DataElement2 = (Uint8)((Float32DataElement &gt;&gt; 8) &
0xFF)
data_out : Uint8DataElement3 = (Uint8)((Float32DataElement &gt;&gt; 16) &
0xFF)
data_out : Uint8DataElement4 = (Uint8)((Float32DataElement &gt;&gt; 24) &
0xFF)
</PRE><BR>
</OL>

The end of line is D:hex A:hex (LF/CR).

There are no closing </LI> tags for your list items.
With those tags, the html file imports the way you want.
Without those tags, I get the problem you report.
(Using Word 2003.)

Even though it passes as valid HTML without those closing tags, apparently
Word wants those tags. Microsoft has always been at odds with the HTML
specs.

See if this shortcut works for you:
In your HTML files, replace <PRE> with </LI><PRE>
 
CAndersen (Kimba) said:
There are no closing </LI> tags for your list items.
With those tags, the html file imports the way you want.
Without those tags, I get the problem you report.
(Using Word 2003.)

Doh! Thanks - I'll go and try that.
 
Back
Top