Web page archived as of 2018-05-22. Some links & features might not work.

eMail highlighting for GeSHi


This posting is outdated. DokuWiki comes with its own GeSHi e-mail highlighter since some years. Below example shows what it produces. Unfortunately, it does not support clickable URLs. Besides, my own code is slightly broken. (2013-08-03)

DokuWiki, the wiki this Wiki is running on :-) uses the Generic Syntax Highlighter GeSHi to put color on listings of programming source code, the so-called syntax highlighting.

I wrote a first draft version of a highlighter for e-mail messages (RFC 822 style) which can be used with GeSHi. If you want to try it download email.php.txt, rename it to email.php and copy it to your ''geshi' folder. Of course, you might want to check that the permissions are correct.

In DokuWiki this can be used for something like

As one can see it can't do everything. Either due to restrictions on GeSHi's side or my ignorance I found no way to i.a.

  • Support (all) symbols and numbers in clickable URLs and mail addresses (interferes with built-in number highlighting).
  • Avoid text after > to appear as comments if they aren't. GeSHi since recently supports DISALLOWED_BEFORE but one can only specify single characters for it.
  • Highlight dates (interferes with the builtin number highlighting).
  • Make URLs and addresses clickable in comments.

Anyway, it does help me and maybe others can help or find some use for it.

Maybe, I should note that GeSHi offers more flexibility by its use of regular expressions but nevertheless it interferes with the highlighting of numbers which is enabled in DokuWiki, and there seems to be no way of disabling it from within a language file.

blog/080428_email_highlighting_for_geshi.txt · Last modified: 2013-08-03 15:02 by andreas