WP-Syntax Plugin JavaScript Operators

Hey all, just a quick post, not really Isogenic related but it might help developers using wordpress to present code fragments to their users.

When using the WP-Syntax plugin in wordpress, an annoying problem when using the visual editor is that it will convert pointy-brackets and some other normal text characters into their HTML entity equivelents such as converting a < into &lt;.

When this is displayed in code, instead of your pointy bracket you’ll get the &lt; or &gt; which obviously breaks any code you’ve written.

The workaround is to edit the WP-Syntax plugin in the wp-syntax.php file on line 114 and change it from:

$geshi = new GeSHi($code, $language);

To:

$geshi = new GeSHi(htmlspecialchars_decode($code), $language);
  • Greg

    You, kind sir, just saved me hours of troubleshooting. Thank you for posting this!

    • http://www.isogenicengine.com Rob Evans

      No worries! Thanks for taking the time to comment! :)