Problem
In WordPress, to make the posts more user friendly, I installed WP-Syntax to highlight the syntax of the code in my posts. However, the HTML entities like “<” cannot be displayed correctly. And it is shown as the original HTML code “<” instead of “<“.
Reason
GeSHi converts the HTML special chars to HTML entities with its own hcs() function.
Solution 1 – Recommended
In latest version of WP-Syntax, there is a parameter “escaped” can help to do this.
<pre lang="php" escaped="true">...</pre>
Solution 2 – Old versions
Modify the WP-Syntax plugin directly. Change below line
$geshi = new GeSHi($code, $language);
To
$geshi = new GeSHi(htmlspecialchars_decode($code), $language);
Reference
Escaping problem with WP-Syntax WordPress plugin