WordPress and GeSHi CodeHighlighter Plugin, Cool but Buggy
After I had played around a bit with WordPress, I took a look in the plugin directory. Its size and diversity nearly challenges the humongous Firefox extension database. Since one of my intentions with Timblog is to publish code snipets I write, a particular plugin caught my eye: CodeHighlighter, a plugin that automatically highlighted code syntax in posts using the GeSHi PHP class.
I watched the demo, and without doubting for a second I downloaded the plugin. Easy as pie — I downloaded it, unzipped it, uploaded the folder to /wp-content/plugins/ and went to the Plugins tab to activate it.
The first two attempts, which were very simple worked flawlessly. The code got pretty colours, and the functions were even hyperlinked to their respective perldoc pages. Only thing I missed was line numbering.
When I tried a bit more complexed code, containing regular expressions, on the other hand, CodeHighlighter turned against me. First it refused even rendering the code. The problem was an HTML tag inside one of the regular expressions, which somehow messed things up. Other problems occured after I circumvented that one by changing the Perl code:
- A plus sign mysteriously disappeared from a regular expression:
s/ / /became tos/ //. Problem “solved” by removing that part of the code. - An uneven, but correct, number of quotation marks in a regular expression caused the GeSHi engine to interpret it as a very long multi-line string. Problem solved by changing the regexp, which incidentally actually made the code more effective.
- Tags in a regular regexp just ruined stuff. Solved by replacing the greater-than and lesser-than signs with wild cards (
.). - Backslashes were removed. Solved by escaping them, replacing
\with\\.
Don’t get me wrong — CodeHighlighter is a really good and easy-to-use syntax highlightning plugin, and I recommend it. I just had to mention this since I struggled in well over an hour with it.loan 800 bank9 9 loan payment autofederal 9 direct loanstudent nursing 9 loan13 9 payday quick loan paydaycredit 90 bad day for loanloans bad 90 credit daymortgage loans 97 financing Mapfux pregnant moviesmovies umd pspmovies domain horror publicsapphic schoolgirl moviesscariest moviemovie sexy scenes clipsmovie shemale galleryporn soft movies core Map

Update: The problem with the disappearing plus signs can be solved by replacing it with
%2B. It is still a bit irritating, though.Comment by Tim — July 13, 2006 @ 9:41 pm