2104: provide a way to map file extensions to syntax highlighting

devin.******@gmai***** (Google Code) (Is this you? Claim this profile.)
Our product runs on Drupal, so PHP files end in .module/.inc/.install etc...and the diff highlighting in Reviewboard treats them as plaintext.

We get around this in Doxygen highlighting by mapping file extensions to a parser - can this be done in ReviewBoard/Pygments?
#1 jsi****@kouka***** (Google Code) (Is this you? Claim this profile.)
I hacked rng support with this nasty patch on reviewboard/diffviewer/diffutils.py :

>     from pygments.lexers import XmlLexer
<         lexer = get_lexer_for_filename(filename, stripnl=False,
>         if filename.endswith(".rng"):
>              lexer = XmlLexer(stripnl=False, encoding='utf-8')
>         else:
> 	     lexer = get_lexer_for_filename(filename, stripnl=False,

But for real usability, there need be storage for custom pairs - filepattern x lexer..
#2 david
  • +Component-DiffViewer