[Doc-SIG] Documentation markup & processing / PEPs

David Goodger dgoodger@bigfoot.com
Fri, 15 Jun 2001 22:04:32 -0400


on 2001-06-15 5:23 AM, Tony J Ibbs (Tibs) (tony@lsl.co.uk) wrote:
>>> 5. Did it mention whether line breaks were allowed in
>>> things? Should be no for literals, yes for other quoted
>>> thingies...
>> 
>> Inline literals:
>> 
>> """
>> Line breaks are *not* preserved; other whitespace is not
>> guaranteed to be preserved.
>> """
>> 
>> If you want linebreaks & whitespace preserved, use literal
>> blocks instead.
>> I'll add that to the spec.
> 
> I see. *But* I would argue that whitespace preserving in inline literals
> *is* important (personally, I don't care if a linebreak in an inline
> literal is mapped to a single space or illegal). It's not a showstopper
> (heh, I'm one of the people who argued for losing escape characters and
> using literal blocks instead, so I don't think I can grumble too much if
> the argument is used back at me), but I think it might be a major
> inconvenience (which, he awkwardly maintains, the other would not...).

Note that "is not guaranteed" is written, on purpose, specifically to cover
cases of output formats that can't preserve whitespace.

I just did a test, with this HTML:

"""
<HTML>
<BODY>
<P>A test: <TT>One space here</TT>, <TT>two  spaces  here</TT>, <TT>Two
  spaces,  
  newline,  
  two  
  spaces</TT></P>
</BODY>
</HTML>
"""

MS IE 5.0 on MacOS 8.6 reduced all contiguous whitespace within TT tags to a
single spaces. Ditto for Netscape Communicator 4.7. Is there another inline
HTML tag which *preserves* runs of whitespace?

I'll amend the spec along the lines of "although every attempt to preserve
whitespace will be made, it is not guaranteed to be preserved," and
specifically mention HTML's TT behavior.

-- 
David Goodger    dgoodger@bigfoot.com    Open-source projects:
 - Python Docstring Processing System: http://docstring.sf.net
 - reStructuredText: http://structuredtext.sf.net
 - The Go Tools Project: http://gotools.sf.net