I never really liked the way my code looked here so I finally looked for a Drupal plugin which handles syntax highlighting. I found exactly one:
GeSHi filter. While it does work, it does not seem to work too well. Much code on this site is batch stuff and the list of Todos and known issues is all but reassuring:
* TODO (updated 2005/07/05)
* -------------------------
– Find a way to higlight %*
* – Highlight pipes and redirection (do we really need this?)
* – Add missing keywords.
* – Find a good hyperlink for keywords.
* – Improve styles.
KNOWN ISSUES (updated 2005/07/07)
* ---------------------------------
– Doesn't even try to handle spaces in variables name or labels (I can't
* find a reliable way to establish if a sting is a name or not, in some
* cases it depends on the contex or enviroment status).
* – Doesn't handle %%[letter] pseudo variable used inside FOR constructs
* (it should be done only into its scope: how to handle variable it?).
* – Doesn't handle %~[something] pseudo arguments.
* – If the same keyword is placed at the end of the line and the
* beginning of the next, the second occourrence is not highlighted
* (this should be a GeSHi bug, not related to the language definition).
* – I can't avoid to have keyword highlighted even when they are not used
* as keywords but, for example, as arguments to the echo command.
Obviously some things here are limitations of the engine itself which leaves me longing for
Colorer but getting that to work with PHP could be a bit of a challenge (although there seems to be
some kind of possibility to get it to work in the web). Meanwhile I try to fix the limitations as they occur, I've already added
enableextensions and
enabledelayedexpansion as things to recognize and highlight.