tags:

views:

50

answers:

0

I have my Drupal installation set up to use both Texy for markup (hand-writing HTML soon gets tedious) and GeSHi for syntax highlighting (which is about the only syntax highlighter I found for Drupal at that time).

The problem now is that since the last update to Texy seemingly nothing really works anymore. I spend a long time trying to convince both of them working together a while ago but it was a pretty flaky setup. Depending on the order of evaluation of both filters I either get no syntax highlighting or all, escaped HTML output, line breaks disappear or, sometimes, it can indeed work.

I am now at a point where it almost works again, but with exceptions. Ideally GeSHi would take care of the code, while Texy handles the rest, but that's not the case. The nice regular expression

[1–9][0–9]*[WDwd][1–9][0–9]*(\+[1–9][0–9]*)?

gets the part between the first two asterisks italicized, since Texy runs over that part as well. Which is unfortunate, since it changes the meaning of the regex.

Anyone out here who has insights of how to peroperly set up multiple filters for input in Drupal and how to handle non-HTML markup and syntax highlighting simultaneously. As I currently have to go over every post that contains code I have written (nearly all) it wouldn probably not much less work to completely redo every page on the site in search for a better setup. As for syntax highlighting, I have much need for the usual common languages, such as C#, Java, etc. but also for more esoteric ones like Windows batch files or Powershell. Simply dumping unhighlighted code there isn't very pretty.

So, actually I have two questions here:

  1. How can one convince multiple input filters to work without interfering with each other, specifically Texy and GeSHI?
  2. What other options are out there that meet my requirements of easy-to-write non-HTML markup1 and syntax highlighting even for lesser-used languages2?


1 Often I just need emphasis and strong emphasis, sometimes headings, often images, sometimes also tables. Oh, and usually code :-)

2 The Stack Overflow-like guessing for syntax highlighting doesn't work very well for most code, it just works well enough to be a little pleasing.

related questions