Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

how to make geshisyntaxhighlighting working with Q&A plugin

This discussion is related to the Q&A addon.

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')

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    jackmaessen
Sign In or Register to comment.