337: Detect script's language for syntax highlighting from #! line.
- Fixed
- Review Board
zhi****@gmai***** (Google Code) (Is this you? Claim this profile.) | |
|
|
1701 |
I've noticed that reviewboard doesn't detect the language of a script from the #! line -- it appears to rely on the file extension. Would it be possible to use the #! line to detect the language type for syntax highlighting?
We use Pygments for our syntax highlighting. We can either tell it to guess the type (in which case it'll likely look at #!) or by file extension. We use the file extension because Pygments used to be horribly slow with some file types (XML, for example). I'm not sure if this has since been fixed. We can certainly experiment with it, but I'd like to add caching of the lexer type for the highlighting before we do that, so we only have to guess it once.
-
- Type-Defect - Priority-Medium + Type-Enhancement + Priority-Low + Component-DiffViewer