WAS: Safe Source Code Highlighting in WordPress 2.02
Since this is a blog large to be devoted to source code segments, I REALLY wanted to be able to do the kind of code highlighting I’ve seen in Forum software such as that used at Codingforums.com. An inadvertent search for how to do a StrToInt (that’s a Delphi function) in PHP (the answer is IntVal()) I found a php unit with Delphi references. I thought it was a neat little unit so I bookmarked it. It turns out it was part of the source code for GeSHi the Generic Syntax Highlighter. Geshi was the syntax highlighter built into phpBB. It since grown into a fully independent universal PHP class available over at http://qbnz.com/highlighter/index.php
The latest stable version of GeSHi is 220.127.116.11, released on the 25th of February, 2006.
I was absolutely tickled when on a whim I did a search for Geshi and WordPress to see if anyone else had tried to integrate it and low and behold, I suddenly found a GeSHi plugin over at the worpress plugin site.
It works beautifully. Especially since it stays within the width of hte columns and no other highlighting boxes I tried had done that without specific widths begin set.
You can already see it at work in php and delphi code form earlier posts here. Enjoy!
 Grrrrr… Something I’ve done has changed my blog so that I must explictly specify <br /> at my end points!!! [/edit]
 Double Grrrrr… It is the GeSHI plug in! it is stripping out all p tags from the whole page!?!?!?!?!
Gack…. the plug in is fatally flawed…. This is disappointing… I liked all of my color code…
OK – Here’s the fix – use the igHiliter. It seems to work MUCH better. More on this later.