tools: Stop initial blank lines being stripped.

This commit is contained in:
Andrew Hamilton 2021-07-25 01:51:40 +10:00
parent 4197cebd1b
commit c4fb3fdfe3
3 changed files with 5 additions and 1 deletions

View file

@ -154,7 +154,7 @@ def _syntax_highlight(text, lexer, style):
def _syntax_highlight_using_path(text, path): def _syntax_highlight_using_path(text, path):
lexer = pygments.lexers.get_lexer_for_filename(path, text) lexer = pygments.lexers.get_lexer_for_filename(path, text, stripnl=False)
style = pygments.styles.get_style_by_name(os.environ["PYGMENT_STYLE"]) style = pygments.styles.get_style_by_name(os.environ["PYGMENT_STYLE"])
return _syntax_highlight(text, lexer, style) return _syntax_highlight(text, lexer, style)

View file

@ -1,2 +1,4 @@
 
 
def hi():  def hi(): 
 print("hi")  print("hi")

View file

@ -1 +1,3 @@
 
 
def hi(): def hi():