GeshiSyntaxColorer WordPress Plug in – DON’T USE IT in WP 2.02

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 1.0.7.7, released on the 25th of February, 2006.

Supported Languages: Actionscript; ADA; Apache Log; AppleScript; ASM; ASP; AutoIT; Bash; BlitzBasic; C; C for Macs; C#; C++; CAD DCL; CadLisp; ColdFusion; CSS; Delphi; DIV; DOS; Eiffel; FreeBasic; GML; HTML; Inno; Java; Java 5; Javascript; Lisp; Lua; Microprocessor ASM; MySQL; NSIS; Objective C; OCaml; OpenOffice BASIC; Oracle 8 SQL; Pascal; Perl; PHP; Python; Q(uick)BASIC; robots.txt; Ruby; Scheme; SDLBasic; Smarty; SQL; T-SQL; VB.NET; Visual BASIC; Visual Fox Pro; and XML.

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.
http://dev.wp-plugins.org/wiki/GeshiSyntaxColorer.

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!

[edit] Grrrrr… Something I’ve done has changed my blog so that I must explictly specify <br /> at my end points!!! [/edit]

[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…
[/edit]

[edit]
OK – Here’s the fix – use the igHiliter. It seems to work MUCH better. More on this later.
[/edit]

Add a Comment

Your email address will not be published. Required fields are marked *