Skip to content
Snippets Groups Projects
Commit bcdfb607 authored by Alexander Plavin's avatar Alexander Plavin
Browse files

highlight: fix page layout with empty first and last lines

Repeated newlines were stripped by pygmentize, now give the option not to do so.
parent e958b176
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@
# To get multi-line strings right, we can't format line-by-line
try:
lexer = guess_lexer_for_filename(fctx.path(), text[:1024])
lexer = guess_lexer_for_filename(fctx.path(), text[:1024],
stripnl=False)
except (ClassNotFound, ValueError):
try:
......@@ -42,4 +43,4 @@
except (ClassNotFound, ValueError):
try:
lexer = guess_lexer(text[:1024])
lexer = guess_lexer(text[:1024], stripnl=False)
except (ClassNotFound, ValueError):
......@@ -45,5 +46,5 @@
except (ClassNotFound, ValueError):
lexer = TextLexer()
lexer = TextLexer(stripnl=False)
formatter = HtmlFormatter(style=style)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment