WordPress Plugin for Google Syntax Highlighter
I am a big fan of the source code highlighter used by the Waffle project. Michael Ward recommended it for me to use when I set my blog up a few weeks ago.

The highlighter itself is simple to use on its own - it’s just a javascript include but I had been using another code highlighter which had a WordPress plugin that made it’s use a snap.
I figured it wouldn’t be too hard to create a plugin for the syntax highlighter (which had larger language support including ruby which I needed) and so I did. The plugin is being hosted by WordPress and I encourage you all to take a look and use in your own blogs.
August 22nd, 2007 at 7:09 pm
Thanks Peter - this is gold!
October 9th, 2007 at 6:52 pm
This doesn’t seem to work with 2.3. I’ve installed, activated, and input even the test syntax you have posted, and, it just doesn’t do anything… at all.
Looked awesome too 
October 18th, 2007 at 7:00 am
hi,
nice plugin and it works with 2.3,
but: your plugin writes class=”javascript” in the script tags. this is wrong and produces an xhtml validation error.
see: http://www.validome.org/validate/?uri=http://www.peterryan.net
it would be better if you use the attribute type instead of class for script tags.
July 20th, 2008 at 8:22 pm
[…] | Author: Peter Ryan Coloring: #4 of 8 Ease of Install/Use: #7 of 8 Line Numbers: Optional PRE or CODE: PRE Other […]
July 23rd, 2008 at 5:50 pm
Very nice plugin !
I’ve made some small changes to your HTML markup to get it W3C valid. You can get the modified version here : http://lapin-blanc.net/downloads/google_syntax_highlighter.phps
With this patch, only the plugin markup will be valid, the core JS code always require to use which is invalid.
Please include my changes in trunk
July 24th, 2008 at 1:14 am
Hi Peter,
I use it on my site and it works very nice. I also made few changes to load only brushes that are needed and move load of JavaScript files to the top of HTML page.
Thank you for your plugin!
September 7th, 2008 at 8:53 pm
Thanks a lot.
October 29th, 2008 at 9:05 am
Thanks a lot for this plugin.
One request though. Brush for bash shell script would be really cool feature.
October 29th, 2008 at 12:08 pm
I’ve added bash brush to the plugin. You can get the extended version of the plugin from here
http://tech.xlab.si/wp-content/uploads/google-syntax-highlighter-with_bash-151.zip
Thanks a lot to bboy.mr.freeze.
November 6th, 2008 at 10:34 pm
The plugin crack’s the html validation !
In the function hooked up to the footer you should be use this
November 13th, 2008 at 2:38 pm
FYI…
Your example on the installation page of your plugin page has a typo.
http://wordpress.org/extend/plugins/google-syntax-highlighter/installation/
It is missing the equal sign between class and “ruby”
December 17th, 2008 at 8:41 pm
Hi Peter,
I vote for the HTML W3C bug discovered by various people earlier in your comments. Please change the class=”javascript” to type=”text/javascript” in your script declarations and republish the plugin.
Anyway, thank you for the plugin,
Simon
February 3rd, 2009 at 5:42 pm
[…] After looking at a few of the recent smashing magazine posts and specifically 10 killer wordpress hacks I decided it was time to look into Wordpress Syntax Highligher Plugins. A quick Tweet later and I had a fantastic round-up from Chris Cagle who runs a small web company. Amazing list ad to have all the work done and a test below to prove it works. I went with the solution from Peter Ryan of Google. […]
February 10th, 2009 at 8:36 pm
I found, by default, the rendered code is padded by wordpress, creating gaps between the lines. I found adding the entry below to the main style.css page, it resolved the issue. There might be a way to do this from the plugin’s css, but this won’t affect anything else so it should be ok.
html > body .entry .dp-highlighter li {
margin:0;
}