naokij / dokuwiki-plugin-markdownextra

Parses PHP Markdown Extra blocks for dokuwiki with backlinks, header parser, toc support
Other
31 stars 27 forks source link

Adding GeShi support #3

Closed ghost closed 11 years ago

ghost commented 11 years ago

I'm trying to implement GeShi support using this method by another project

I only know enough to do things by trial and error so wonder if you have any advice. Would the appropriate place to do this be in syntax.php inside the DOKU_LEXER_UNMATCHED case (replacing the part where it calls Markdown($match))?

naokij commented 11 years ago

I think it's easier to run the code through a client side JavaScript script. All you have to do is to add a CSS class to the code and let JavaScript to do the rest.

发自我的 iPad

在 2013年10月8日,下午2:27,Justin K notifications@github.com 写道:

I'm trying to implement GeShi support using this method by another project

split the input into code and text run the code through GeShi, run the text through PHP Markdown Extra join them back up I only know enough to do things by trial and error so wonder if you have any advice. Would the appropriate place to do this be in syntax.php inside the DOKU_LEXER_UNMATCHED case (replacing the part where it calls Markdown($match))?

— Reply to this email directly or view it on GitHub.

naokij commented 11 years ago

Please try Prism. Prism is a lightweight, extensible syntax highlighter written in Javascript.

http://prismjs.com

ghost commented 11 years ago

Thanks for the suggestions. I actually managed to implement the technique used by beautify but there're other drawbacks like broken footnotes, so going with JS until I can figure out another way.