in reply to Re: Ensuring HTML is "balanced"
in thread Ensuring HTML is "balanced"

...So since the cleaned up HTML in fact has a broken p tag, are we free to assume that the Lint report *and* Treebuilder handle P tags in an amusing manner?

Replies are listed 'Best First'.
Re^3: Ensuring HTML is "balanced"
by GrandFather (Saint) on Mar 26, 2008 at 01:45 UTC

    Actually HTML doesn't require that some tags (including p tags) be closed. In particular the HTML 4.01 specification in section 9.3.1 says:

    Paragraphs: the P element
    Start tag: required, End tag: optional

    so strictly speaking the p tag is not broken.


    Perl is environmentally friendly - it saves trees
Re^3: Ensuring HTML is "balanced"
by ww (Archbishop) on Mar 26, 2008 at 00:47 UTC
    This is a common misconception (and one which I think reflects what the standard *SHOULD* be). Even though the close </p> tag is mandatory for certain other standards, </p> is optional in html 4.01, per http://www.w3.org/TR/html401/struct/text.htm and other w3c references:
    9.3.1 Paragraphs: the P element
    ...
    Start tag: required, End tag: optional

    Whether or not this stands in the forthcoming html 5.0 standard is unknown.