Ian Bicking: the old part of his blog

HTML spellcheck

HTML comment boxes (or any TEXTAREA where we enter HTML) should have an HTML spellcheck. Not actually spelling (maybe that, but I've never seen one I liked). Instead it should check the HTML makes some sense. pre lines don't go too long. All the tags match up -- not necessarily valid XHTML, but a more forgiving version of validity. None of the links return 404. Everything that looks like a URL is also a link.

To some degree the checker could fix things for you. mxTidy is a pretty good solution to most HTML validity problems. But if it's messed up enough (or gives a 404, for instance), there's no choice but to ask the user to fix it themselves. The hard part is setting up a program flow where you can requery the user, looking for corrections, give the user the corrected version, let them get their original version, ask them to correct problems that can't be automatically corrected, define a threshhold where you will correct for the user without confirming, and let the user indicate that they really want to do something you think they shouldn't (like maybe they'll want to link to a URL, knowing that it will go live very soon). Good stuff if you do it, though. Begging for a server-side HTML widget framework...

Created 25 Oct '03
Modified 14 Dec '04


Take a look at Jesse Ruderman's Blogidate XML Well-formedness bookmarklet: http://www.squarefree.com/archives/000033.html

When you activate the bookmarklet, it checks all of the textareas on the current page and changes their background colour to green or red depending on whether or not they contain valid XML.
# Simon Willison