Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

how to make geshisyntaxhighlighting working with Q&A plugin

When an answer has a codeblock witch is highlighted by geshi, and someone accept this answer, the comment with codeblock is not anymore highligted when it moves to the top of the topic. Does anyone has a solution for it?
So the geshi div what normally is parsed around the pre tags disappears.
So i think, there must be some addition in Q&A plugin to include the geshi div when its moving to the top of topic.
I just don't know how to handle with this problem...

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I don't think any code highlighter works perfectly with quotes or Q&A .

  • jackmaessenjackmaessen ✭✭✭
    edited December 2014

    Well, Prettyprint and GoogleCode prettify work without problem with Q&A; when moving to top of topic, the highlighting stays intact. But these two plugins do the highlighting with javascript, and geshi uses php files for highlighting. For that reason, it is also very easy to build a "Select Code" just before the body parsing. And with the other two plugins i have trouble with that .

    For some time ago, Shadowdare built something in geshi for me to work together with the BasisPages Addon.

      /* 
         * Basic Pages application support.
         * Parses the page body through the GeSHi Syntax Highlighter.
         *
         * @author Shadowdare
         * @calls ParseSyntax()
         */
          public function PageController_Render_Before($Sender) {
            $Page = &$Sender->Data('PageData');
    
            if($Page->RawBody == '0')
                $Page->Body = ParseSyntax($Sender->Data('PageData')->Body);
        }
    

    Maybe i can do something with that but i just don't know how to make this possible with the Q&A

  • The Q&A plugin separates the normal posts and answer posts.

    I think you could achieve what you want by running ParseSyntax (like in the BasicPages fix above) on each element of $Sender->Data('Answers')

Sign In or Register to comment.