Re: Ignoring empty paragraphs

On Sun, 9 Apr 2000, Jan Roland Eriksson wrote:

> On Tue, 4 Apr 2000 03:09:26 -0400 (EDT), "Braden N. McDaniel"
> <> wrote:
> >On Tue, 4 Apr 2000, Jan Roland Eriksson wrote:
> >> On Mon, 3 Apr 2000 19:53:18 -0400 (EDT), "L. David Baron"
> >> <> wrote:
> >> > 1) An empty P element should be ignored at the parsing stage, and
> >> >    therefore should not appear in the DOM and should not be affected
> >> >    by style sheets.
> >> 
> >> This is the correct interpretation.
> [...]
> >> If there's nothing to mark-up, there's no motivation for markup either.
> >Indeed, but it is *not* the parser's job to fix errant document structure! 
> >It is the parser's job to read the markup that's there. And as long as
> >it's valid, the DOM tree should have a direct correspondence to the
> >plaintext representation.
> Fair enough. But...
> What about "styling" of non existing content?
> Leave that no-content element dangling in the DOM tree and we need to
> move the decision not to style it to the CSS renderer instead.
> If not, we will not have a way to discourage the use of successive P's
> for vertical spacing, and that is what I think David's question was all
> about.

Hm. That's a good point. I think the bottom line here is that the rule in
the HTML spec is Stupid: if the spec authors wanted to discourage empty P
elements, they should have made them altogether illegal.

But I've come around to agree with you on this. The HTML spec appears to
make it the job of the parser to fix bad markup. The wording is, "User
agents should ignore empty P elements," not, "User agents should hide
empty P elements."

Braden N. McDaniel

Received on Sunday, 9 April 2000 20:40:26 UTC