Skip to content

Archive for November 1st, 2006

Minimized Tag Syntax

Wednesday, November 1st, 2006

I noticed recently noticed something missing from the W3C XHTML validator. There is no check for when you use minimized tag syntax on an element whose content model isn’t empty.

The validator accepts <p/> as valid code, but according to the W3C documentation, it shouldn’t be allowed. The W3C recommends using <p> </p> if you require an empty paragraph block.

It’s surprising that this got left out of the validator. It would seem like a fairly simple thing to check for. But fear not, I’ve never seen a browser that has any trouble interpreting <p/> as an empty paragraph block.

Updated Nov 7
I added it to Bugzilla bug report for the validator. Apparently it’s just considered a best practice and not actually required for validation. There are plans to eventually have a check for best practices as well as the regular validation.