##// END OF EJS Templates
highlight: exit early on textual and unknown files (issue3005)...
av6 -
r25899:c35ee1bb default
parent child Browse files
Show More
@@ -49,7 +49,12 b' def pygmentize(field, fctx, style, tmpl)'
49 try:
49 try:
50 lexer = guess_lexer(text[:1024], stripnl=False)
50 lexer = guess_lexer(text[:1024], stripnl=False)
51 except (ClassNotFound, ValueError):
51 except (ClassNotFound, ValueError):
52 lexer = TextLexer(stripnl=False)
52 # Don't highlight unknown files
53 return
54
55 # Don't highlight text files
56 if isinstance(lexer, TextLexer):
57 return
53
58
54 formatter = HtmlFormatter(nowrap=True, style=style)
59 formatter = HtmlFormatter(nowrap=True, style=style)
55
60
General Comments 0
You need to be logged in to leave comments. Login now