in reply to Re^4: Add < /br> to Approved tags?
in thread Add < /br> to Approved tags?

But it is not a hazard to navigation.

The real problem I see here is that HTML nesting enforcement is optional. If it were required, then those trying to use </br> would immediately see their mistake and learn something in the process.

I'd appreciate (and certainly try to apply) any patch that unconditionally enables HTML nesting enforcement in preview (with the already-plumbed, I believe, user-selected "error reporting level for preview"), as the easiest short-term fix with the "most bang for the buck".

In seeing how common the </br> mistake is and further that both IE and FireFox silently interpret </br> as <br />, I've been tempted to have PM also make that silent transformation. But I'm not convinced that is the best idea. But it doesn't matter because it won't be any time soon before I could make such a change, anyway.

As for the minor point of those claiming that <br /> is invalid HTML since PerlMonks doesn't tag its output as "XHTML", I'll note that the HTML standard defines lenient treatment of parts not expected and so, last I heard, <br /> in HTML is precisely defined to be treated as <br>. If someone is having some practical problem with the use of <br /> in PerlMonk's output, please be specific. The partial conformance to XHTML can be useful (for those parsing parts of PM output) but tagging the output as XHTML would be bad since the conformance is not complete. So I'm inclined to continue moving toward XHTML while not violating the HTML standard in any practical way.

- tye        

Replies are listed 'Best First'.
Re^6: Add < /br> to Approved tags? (rub)
by ww (Archbishop) on Jun 20, 2007 at 21:20 UTC
    Tye I give this a major ++.

    However I am not sure I understand your third paragraph as you intended. My confusion stems from this:

    Regxp: signaling when to stop and Re: use lib functionality are the latest among the June-to-date nodes which use "</br>."

    In the case of the second (for its brevity), the opening line(s) render this way (color and font excepted), for me, in IE6, FF & Moz:

    Hi,</br></br> This Module simplifies the manipulation of @INC at compile time.</br></br> Using

    When observed with ViewSource (html validator is on), I see:

    <p> Hi,<font color="#808080" class="htmlignored">&lt;/br></font><font colo +r="#808080" class="htmlignored">&lt;/br></font> This ...</p>

    Is this an indication that the </br> tags were processed by an existing "silent (and automated) transformation" or merely an artifact of the browser, ViewSource and the validator?

      No, IE and FireFox don't render ­&lt;/br> the same as <br />. They render </br> as if it were <br /> (and even render <br></br> as if it were <br /><br />). If you want to use PerlMonks to test that, then turn off HTML nesting enforcement so that the browser will see </br> (not &lt;/br> or nothing).

      HTML nesting enforcement will remove and/or add tags to attempt to make the node well-formed so it won't impact the display of surrounding material. If you have its error reporting turned up high enough, then it will also add greyed-out information about what was removed or added. So the original (invalid) </br> is removed by it and, for you, a greyed-out version is inserted so the transformation is not "silent" in this case.

      It is sad that "view source" (in the case FireFox, at least, last I checked) doesn't always faithfully show the source that it received so that people are left guessing.

      - tye