Well, I set up this blog and then wanted a code syntax highlighter, because those are nifty. I installed this plugin and all seemed well. Then though I noticed the little XHTML link on the right side of the blog that is installed there by default and I clicked on it and it went over to the W3C validator where my new blog validated improperly! And all due to my new syntax highlighting plugin.
Well, it seems that this plugin is based on an older version of the Google Syntax Highlighter which doesn’t conform to standards.
The new one apparently works a bit differently in how it selects DOM elements.
The old one uses a pre tag with a “name” attribute as the selector and XHTML 1.0 doesn’t know from a name attribute in a pre tag.
function FindTagsByName(list, name, tagName)
var tags = document.getElementsByTagName(tagName);
for(var i = 0; i < tags.length; i++)
if(tags[i].getAttribute('title') == name)
So I altered the selector code a little so it finds by the “title” attribute instead. Perhaps I’ll just update the plugin code to use the new version of the SyntaxHighlighter, but for now this seems to work fine.