Installed Dean’s Code Hightlighter plugin today. It uses my favourite Geshi highlighter and very simple to use. Just wrap the code in <pre lang=”php”> </pre> block, and everything gets highlighted automatically.
But there’s a strange bug: single quotes inside the code block are replaced with curly quotes. So, if you decide to copy this code into your IDE, you’ll get a handful of parsing errors. There was a solution posted in a comments: to comment out wptexturize filter in default-filters.php.
I believe that if the plugin doesn’t work correctly, than you first should try to fix plugin, and only then modify core files. So I opened my IDE and coded the following solution
deans_code_highlighter.php, line 71
// set priority to 10, to execute filter after all other filters. add_filter('the_content',array(&$this, 'ch_the_content_filter'),10);
deans_code_highlighter, line 84
// change $search and $replace, so that they would look like this. $search = array("&quot;", "&lt;", "&gt;","&#92;","&#39;","&nbsp;", '&#8217;', '&#8216;', '&#8221;', '&#8220;', "&amp;", '&#038;'); $replace = array(""", "<", ">", "", "'", " ", "'", "'", '"', '"', "&", '&');
And that should fix it.
February 27th, 2008 at 10:06 am
May 29th, 2008 at 3:40 pm
Thanks for this fix – I only needed to change the filter priority to 10. I inspected the search and replace array and it already looked correct in the current version as of today