##// END OF EJS Templates
highlight: bail out if file is binary
Brendan Cully -
r6194:fe54e750 default
parent child Browse files
Show More
@@ -55,9 +55,12 b' def pygmentize(self, tmpl, fctx, field):'
55 new_header = old_header + SYNTAX_CSS
55 new_header = old_header + SYNTAX_CSS
56 tmpl.cache['header'] = new_header
56 tmpl.cache['header'] = new_header
57
57
58 text = fctx.data()
59 if util.binary(text):
60 return
61
58 style = self.config("web", "pygments_style", "colorful")
62 style = self.config("web", "pygments_style", "colorful")
59 # To get multi-line strings right, we can't format line-by-line
63 # To get multi-line strings right, we can't format line-by-line
60 text = fctx.data()
61 try:
64 try:
62 lexer = guess_lexer_for_filename(fctx.path(), text,
65 lexer = guess_lexer_for_filename(fctx.path(), text,
63 encoding=util._encoding)
66 encoding=util._encoding)
General Comments 0
You need to be logged in to leave comments. Login now