Re: Correct syntax of <LI> tags

Daniel W. Connolly (connolly@beach.w3.org)
Wed, 21 Jun 1995 12:42:38 -0400


In message <9506211217.aa10508@dali.scocan.sco.COM>, Murray Maloney writes:
>
>For what it's worth, my reading of the spec and
>experience with browsers is that a space following
>an <LI> should be presented by the browser.

Hmmm... yet more feedback that the spec isn't quite clear.
I think the spec says it shouldn't be presented (see
below).

>Having said that, I will also say that the HTML spec does
>not serve as a specification for browsers, but for the
>language. While it does provide numerous suggestions
>to browser developers, there is no spec for HTML user agents.
>At least not yet.

I have to disagree here. And I think the spec is quite
clear:

Hypertext Markup Language - 2.0 - Introduction
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_1.html#SEC6
Fri Jun 16 19:56:20 1995

|Conformance
|
|This specification governs the syntax of HTML documents and aspects of
|the behavior of HTML user agents.

...

|User Agents
|
|An HTML user agent conforms to this specification if:
|
...

On the particular issue of whitespace an <LI>, the spec is not
quite as clear. My intent was that both Netscape and Mosaic are
conforming user agents (and that in general, information providers
can't rely on how whitespace like this will be handled), but
the browsers that throw out the whitespace before and after
all the words in a block structuring element are preferred.

Hypertext Markup Language - 2.0 - Characters, Words, and Paragraphs
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_6.html#SEC63
Fri Jun 16 19:56:22 1995

|An HTML user agent should present the body of an HTML document as a
|collection of typeset paragraphs and preformatted text. Except for
|preformatted elements (PRE, XMP, LISTING, TEXTAREA), each block
|structuring element is regarded as a paragraph by taking the data
|characters in its content and the content of its descendant elements,
|concatenating them, and splitting the result into words, separated by
|space, tab, or record end characters (and perhaps hyphen
|characters). The sequence of words is typeset as a paragraph by
|breaking it into lines.

>Getting back to the language though, HTML as an SGML application
>should respect white space between the <LI> tag and subsequent
>text.

I don't quite follow. Could you cite your evidence for this
conclusion? A conforming SGML parser will in fact report the space as
part of the content of the LI element. But HTML, as an SGML
application, is free to prescribe whatever sort of processing it dang
well pleases with that space, no?

Dan