If like me, you are a ColdFusion developer using Wordpress as their blogging engine, you might have a need to occaisionally put code samples into your blog posts. With tools like Ray Camden’s BlogCFC and ASFusion’s Mango, this is very easy as they have been designed to do this from the start. However, in Wordpress you need to do some fiddling first.
Ultimately there are a few code highlighters out there that you can use, and I have chosen to use CodeViewer, which lets me upload files of code that then get converted into a nice highlighted form. From here I have a variety of options of things like allowing you guys to download that code in it’s raw form. The highlighting is done via another plugin called GeSHI, the Generic Syntax Highlighter. This is a long term open source project designed to create a PHP based syntax highlighter that can be used from a number of other applications (such as Wordpress) and supports a vast range of languages such as AS3, T-SQL, ColdFusion and others.
However, after saying all this, the currently bundled CFML parser does not contain any of the new CF8 syntax, and has only a limited number of attributes listed. Therefore, I have sat down and updated the language file to include all CF8 tags, functions and attributes, which means that should you be using GeSHI, you should have no real problems with any of the new CF8 syntax.
To download the file, click here. I have also sent off the file to the GeSHI admins in the hope that they can include it in a future release. If you can see any problems, and need some help, please don’t hesitate to contact me.


Thats neat. I use Geshi in my Wordpress powered blog and I spent a lot of time looking for this particular thing. So do I just drop it in the plugins/geshi folder?
That URL you gave is blank.
I’ve updated the link to a .zip, there appears to be an issue with downloading .php’s.
@Anuj yup, just drop it in.
thanks, that worked. I will try that out. Thanks for taking the time to take this up.
Neil, it seems to have a problem with tags nested inside CF comments, and comments that exceed one line. See the **2nd code listing** here: http://tuttletree.com/nerdblog/?p=62
In particular, notice that the comment that begins on line 1 appears to get wrapped and have an extra visible line before line 2 of the code; and that the comment style isn’t applied all the way until the —> - just until the end of the current line.
Then look at line 33 of the same code listing. The self-closing tag (”<tagname />”) appears to be ending the comment style, and I’m pretty sure it’s forcing the line to wrap. (That is, that even if the text didn’t fill the line, it would wrap after the />)
Is this something that can be adjusted in your cfm.php file? If it is and you’re not interested in fixing it, I’ll be happy to take a look, but I don’t know much about geshi yet, so I thought I’d ask you.
@Adam sounds like a GeSHI issue to me. However, feel free to take a look at the cfm.php and see if you can spot anything.