]> The LambCutlet Disorganisation » When draconian XHTML browsers (rightfully) attack!

The LambCutlet Disorganisation

When draconian XHTML browsers (rightfully) attack!

Posted by Jonathan at 22:31:49 UTC on the 29th of September, 2004

Having re-embraced anally retentive XHTML loving just a few days ago having previously hand rolled the blog for a good year or so, I and others have recommended usage of XHTML’s correct MIME-type of application/xhtml+xml as being the way to make sure all mark up output by whatever web application stays 100% well formed.

Not too difficult when every character is something you’ve typed yourself when handrolling, however there are often surprised lurking just around the corner when one is using something a little more dynamic. Ironically, that very post’s permalink announcing my change back suffered from not having a naked ampersand entitised… All because Bruce said there was some ugly :hover generated text reflow in the title as it just happened to be at that awkward length so I changed the “and” to just a “&”. However, luck would have it that the <meta name="DC.title" /> element didn’t run PHP’s htmlspecialchars() function over the $title variable, the root of this little upset.

Likewise, Gallery 1.x’s block-random.php which I use for the “Random Picture” section suffered a similar fate and the fix is just the same. A little bit of a kludge, since should the image description already contain entities or has mark up which shouldn’t be entitised, it does. However; come Gallery 2.0.x, the output by the new block module is 100% XHTML compliant… so much so in fact, the whole application is probably the one I’d put down on my list as needing the least fixes to get it working in browser’s draconian application/xhtml+xml mode with phpBB 2.2.x pretty much even. If anything, it’s just a great way to debug mark up for whatever web application you are working on.

Oh, and for those that love to live on the bleeding edge and are using PHP 5.0.x, libtidy could very much save your backside as it can automagically fix your pages on the fly using the tidy_*() functions or ob_tidyhandler() to catch those unexpected moments! :D

Filed under: Meta, Software

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Due to continued annoyance from spam-bots, this site now uses a Captcha. Disabled users can still submit their comments via my contact form.

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Don't forget that this site support Gravatars!

(required)

(required)

Authorisation code image