From 147b22face65617514ccfa8512c6b097b07cad4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20G=2E=20Chajdas?= Date: Sun, 11 Dec 2022 12:52:23 +0100 Subject: Improve whitespace handling in Python. This triggers a new case in the HtmlFormatter, which emits an empty span at the end of the line for a new line, as those are removed by the split-by-parts code. This requires separate post-processing. Doesn't fix all whitespace issues with Python either, but we're done to 360 failing examples with that, from previously >400. --- .../examplefiles/python/linecontinuation.py.output | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'tests/examplefiles/python/linecontinuation.py.output') diff --git a/tests/examplefiles/python/linecontinuation.py.output b/tests/examplefiles/python/linecontinuation.py.output index 78680c3e..91d4157b 100644 --- a/tests/examplefiles/python/linecontinuation.py.output +++ b/tests/examplefiles/python/linecontinuation.py.output @@ -7,7 +7,7 @@ ' ' Text 'y' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace 'apple' Name '.' Operator @@ -21,9 +21,9 @@ ' ' Text 'y' Name ')' Punctuation -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace '1' Literal.Number.Integer ' ' Text @@ -36,9 +36,9 @@ ' ' Text '__str__' Name.Function.Magic -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'from' Keyword.Namespace ' ' Text @@ -47,7 +47,7 @@ 'import' Keyword.Namespace ' ' Text 'path' Name -'\n' Text +'\n' Text.Whitespace 'from' Keyword.Namespace ' \\\n ' Text @@ -59,9 +59,9 @@ 'import' Keyword.Namespace ' \\\n ' Text 'path' Name.Namespace -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'import' Keyword.Namespace ' ' Text @@ -72,9 +72,9 @@ 'as' Keyword ' ' Text 'something' Name.Namespace -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'import' Keyword.Namespace ' \\\n ' Text @@ -91,21 +91,21 @@ ' ' Text 'something' Name -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'class' Keyword ' \\\n ' Text 'Spam' Name.Class ':' Punctuation -'\n' Text +'\n' Text.Whitespace ' ' Text 'pass' Keyword -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'class' Keyword ' ' Text @@ -113,9 +113,9 @@ ':' Punctuation ' ' Text 'pass' Keyword -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'class' Keyword ' ' Text @@ -124,13 +124,13 @@ 'object' Name.Builtin ')' Punctuation ':' Punctuation -'\n' Text +'\n' Text.Whitespace ' ' Text 'pass' Keyword -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'class' Keyword ' \\\n ' Text @@ -140,11 +140,11 @@ ' ' Text '(' Punctuation -'\n' Text +'\n' Text.Whitespace ' ' Text 'object' Name.Builtin -'\n' Text +'\n' Text.Whitespace ' ' Text ')' Punctuation @@ -153,15 +153,15 @@ ' ' Text ':' Punctuation -'\n' Text +'\n' Text.Whitespace ' ' Text 'pass' Keyword -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace -'\n' Text +'\n' Text.Whitespace 'def' Keyword ' \\\n ' Text @@ -186,4 +186,4 @@ ' ' Text 'pass' Keyword -'\n' Text +'\n' Text.Whitespace -- cgit v1.2.1