changeset 6198 | 358cc9cf54db |
parent 6197 | f6565f7d9489 |
child 6199 | 0068809347d7 |
--- a/hgext/highlight.py Fri Feb 29 14:21:15 2008 -0800 +++ b/hgext/highlight.py Fri Feb 29 14:47:07 2008 -0800 @@ -65,7 +65,10 @@ lexer = guess_lexer_for_filename(fctx.path(), text, encoding=util._encoding) except ClassNotFound: - lexer = TextLexer(encoding=util._encoding) + try: + lexer = guess_lexer(text, encoding=util._encoding) + except ClassNotFound: + lexer = TextLexer(encoding=util._encoding) formatter = HtmlFormatter(style=style, encoding=util._encoding)