Show More
@@ -51,10 +51,10 b' def pygmentize(field, fctx, style, tmpl)' | |||
|
51 | 51 | try: |
|
52 | 52 | lexer = guess_lexer_for_filename(fctx.path(), text, |
|
53 | 53 | encoding=util._encoding) |
|
54 | except ClassNotFound: | |
|
54 | except (ClassNotFound, ValueError): | |
|
55 | 55 | try: |
|
56 | 56 | lexer = guess_lexer(text, encoding=util._encoding) |
|
57 | except ClassNotFound: | |
|
57 | except (ClassNotFound, ValueError): | |
|
58 | 58 | lexer = TextLexer(encoding=util._encoding) |
|
59 | 59 | |
|
60 | 60 | formatter = HtmlFormatter(style=style, encoding=util._encoding) |
General Comments 0
You need to be logged in to leave comments.
Login now