Show More
@@ -38,12 +38,13 b' def pygmentize(field, fctx, style, tmpl)' | |||||
38 |
|
38 | |||
39 | # To get multi-line strings right, we can't format line-by-line |
|
39 | # To get multi-line strings right, we can't format line-by-line | |
40 | try: |
|
40 | try: | |
41 |
lexer = guess_lexer_for_filename(fctx.path(), text[:1024] |
|
41 | lexer = guess_lexer_for_filename(fctx.path(), text[:1024], | |
|
42 | stripnl=False) | |||
42 | except (ClassNotFound, ValueError): |
|
43 | except (ClassNotFound, ValueError): | |
43 | try: |
|
44 | try: | |
44 | lexer = guess_lexer(text[:1024]) |
|
45 | lexer = guess_lexer(text[:1024], stripnl=False) | |
45 | except (ClassNotFound, ValueError): |
|
46 | except (ClassNotFound, ValueError): | |
46 | lexer = TextLexer() |
|
47 | lexer = TextLexer(stripnl=False) | |
47 |
|
48 | |||
48 | formatter = HtmlFormatter(style=style) |
|
49 | formatter = HtmlFormatter(style=style) | |
49 |
|
50 |
General Comments 0
You need to be logged in to leave comments.
Login now