This post originated from an RSS feed registered with Python Buzz
by Ian Bicking.
Original Post: HTML spellcheck
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
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...