The wp-recaptcha plugin for WordPress breaks when you’re serving pages as application/xhtml+xml. I inadvertently broke comments when I installed it (silly me for not testing!). I’ve written a patch that fixes it.
document.write, which isn’t a DOM method and hence is not a method of true XML documents. It’s not a new issue either, wp-recaptcha has had a history of breaking XHTML. The thing is, the WordPress plugin (which uses the PHP library by the recaptcha people) has an option to “Be XHTML 1.0 Strict compliant”; but this only fixes the use of iframes and noscript!
Updated: pushed fork to github
Continue reading “XHTML fixes for the WordPress reCAPTCHA plugin”
When trying to use prettify here on Defective Semantics I ran into problems with firefox. Here are the errors from the error console:
Error: undefined entity
Error: uncaught exception: [Exception...
"Component returned failure code: 0x80004003
nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"
location: "JS frame :: hxxp://example.net/prettify.js ::
replaceWithPrettyPrintedHtml :: line 1414"
My insistence on trying to use XHTML on the blog is partly to blame. Prettify tries to add “ ” entities to the source (even if it’s a pre element) to appease Internet Explorer. This entity only semi-works in XHTML: I’ve run into similar problems with some HTML entities not being loaded, because some browsers don’t load the DTD (which in turn loads the entity sets). It also appears that while Firefox claims to support HTML latin 1 entities in a document with a PUBLIC XHTML identifier, it doesn’t actually reparse innerHTML assignments according to those rules.
document.xmlVersion && (document.compatMode=='CSS1Compat');
which works for Firefox and Opera.
As a separate issue, Chrome and Safari (and presumably anything WebKit based) don’t allow assignment of innerHTML for XML documents, giving
NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
Fixing prettify to use only DOM methods instead of building up a string and assigning it to innerHTML could be a lot of work. At least this exception, unlike the Firefox error, doesn’t leave the pretty-printed block in an inconsistent state.
I submitted a patch to the prettify issue tracker.