hello,

The hack seems not working with the 7.x-dev ?
I've added the lines required on geshi.php, empty the cache but characters < > are l not rendered.

if you have any suggestion..

thank you,
Xavier

Comments

chirhotec’s picture

I was having problems too, but finally figured it out.

First, make sure you put the hack in the proper location (don't just base it on the line number, since that changes between release versions of the geshi library).

    function parse_code () {
        // Start the timer
        $start_time = microtime();

        // Replace all newlines to a common form.
        $code = str_replace("\r\n", "\n", $this->source);
        $code = str_replace("\r", "\n", $code);
        
        //***** hack
        $code = str_replace("&gt;", ">", $code);
        $code = str_replace("&lt;", "<", $code);
        $code = str_replace("&amp;", "&", $code);
        $code = str_replace("&#39;", "'", $code);
        $code = str_replace("&quot;", "\"", $code);
        //***** end of hack

        // Firstly, if there is an error, we won't highlight
        if ($this->error) {
          ....

Second, with the Geshi filter settings, make sure that you add "pre" to the list of Generic syntax highlighting tags (by default it only filters on code and blockcode). The wysiwyg bridge adds pre tags, and not code specific tags (c, java, php, etc.) nor even the code / blockcode tags.