Re: dealing with new-lines

Thomas A. Fine (fine@cis.ohio-state.edu)
Fri, 8 Jan 93 15:52:19 -0500


>> Beacuse
>>each XMP section is like a black box, any white spce inside it would not be
>>seen by the white space management logic which overlaps the white spaces
>>required around successive paragraphs, and extra white spce would result.
>
>Unfortunately, this conflicts with the SGML standard. An SGML parser
>will report
><XMP>
>foo
></XMP>
>
>as
>an XMP start tag
>the string "foo" [NOT "\nfoo\n"]
>an XMP end tag
>
>And so it is, strictly speaking, illegal to treat the above markup
>differently from
><XMP>foo</XMP>
>
>I'm not sure how we should resolve this.

This was almost the exact example I was playing with when I decided to start
this messy discussion. Also some paragraph examples. Both of the following
should mean the same:

some text<P>more text

and

some text
<P>
more text

The latter being commonly used. I realized that unless you could remove
surround new-lines in cases like this, the second paragraph would start
with a space. Similarly, you might find headings, or other things with
a space at the beginning.

>> PRE
>>
>>By the way, I think we agreed (I gave in) that the <PRE> sections would have
>>siugnificant newlines. Your manuals, Tom, have <p> as well as newlines, which
>>gives double spacing on my browsers. So I tread newlines as newlines in all
>>the <PRE> element just as XMP.
>
>This is a situation we need to resolve, one way or another. I'm inclined
>to decide that <p> elements are allowed in PRE elements, but they have
>no significance. They were put there to cause the old linemode browser
>to break the line, so they have always been redundant. So Tim's treatment
>of newlines in PRE is correct, but his treatment of <P> there is not
>[by this new convention.]

Note that the method I proposed has the advantage of automatically dealing
with this (sort of). If the document was converted simply by adding a <P>
to the end of each line, then for such lines, I remove the newline but keep
the <P>. Then the code that deals with PRE sections can happily honor
both new-lines and <P> tags, thus making it compatible with either style.

tom