Problems with WP-Syntax Plugin (GeSHi) with AutoIt
I’ve been having a problem with using the WordPress wp-syntax plugin to highlight my AutoIt code. In a nutshell, it would dump the span tags right onto the page instead of actually styling any of the code.
Not knowing quite how plug-ins work (or GeSHi for that matter), I hacked away at it a bit and it appears to be a problem with the size of one of the keyword arrays. It might be host specific (not enough memory allocated?) or PHP version, or WordPress, or who knows, but I was able to finally resolve the problem.
I broke the KEYWORDS\4 array up into two separate arrays (creating a KEYWORDS\7) and called it “autoitc.php” and it now appears to work fine. When I create my code blocks now I just use lang=”autoit2″ when posting code in my blog. Here’s an example:
1 2 3 4 5 6 7 8 | #cs This is a block of comments It should be colored green #ce dim $tVar $tVar = "Hello World" ConsoleWrite(@AutoItPID & " " & $tVar) |
To apply the same (very unsupported) fix, download this file and upload to same GeSHi folder that has the originally autoit.php. You can replace your existing one if you like with this, but it may get overwritten by updates.
UPDATE: I’ve ugraded to WP-Syntax 0.9.8 and it appears to resolve this issue.
