Valid XHTML user script

The Valid XHTML user script is an adaptation of the blogidate XML well-formedness bookmarklet. It shows a line of text under each textarea indicating whether the text is well-formed XHTML. When the text is not well-formed XHTML, it displays Gecko's error message and gives you a link that selects the location of the error in the textarea. When the text is well-formed XHTML, it displays links that let you check whether the XHTML is valid in addition to being well-formed.

By default, it only runs on admin posting pages for Movable Type and WordPress and on archive pages for Simon Willison's blog. You can use Greasemonkey's interface to make it run on the sites on which you edit XHTML.

Screenshots

Demo for Firefox and other Gecko browsers

4 Responses to “Valid XHTML user script”

  1. Julien Couvreur Says:

    The demo works fine, but nothing happened on Simon’s site…

  2. Jesse Ruderman Says:

    If you install the user script and then go to e.g. http://simon.incutio.com/archive/2005/05/04/spotlight, you should see “Enter XHTML to check it.” below the comment box. If that isn’t working, please tell me what version of Firefox and Greasemonkey you’re using and whether you see any JavaScript errors from Greasemonkey or simon.incutio.com when you load that page.

  3. Julien Couvreur Says:

    I was running GM 0.3 (b I think). The script didn’t seem to trigger (I added an alert at the top, and it wouldn’t pop up). There was no event in the JS console…
    Updated to 0.3.3 and it works now. Are you using any 0.3.3 specific stuff?

    Isn’t this script going to kill the htmlhelp.com site with load?

  4. Jesse Ruderman Says:

    I was running GM 0.3 (b I think). The script didn’t seem to trigger (I added an alert at the top, and it wouldn’t pop up). There was no event in the JS console…
    Updated to 0.3.3 and it works now. Are you using any 0.3.3 specific stuff?

    I don’t know why it didn’t work in GM 0.3. I’m not aware of it using any new features in GM 0.3.3.

    Isn’t this script going to kill the htmlhelp.com site with load?

    The script only uses htmlhelp.com when you click “Validate transitional fragment” or “Validate strict fragment”. It does the well-formedness check locally.