Split lines in lexer only by \r\n, \r and \n
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Python str.splitlines() splits by more characters[1], which, however, causes problems when keeping these special characters in processed templates is desirable, i.e. these bug reports: #769, #952, #1313. The keep_trailing_newlines logic is reworked because splitlines() removes them already (so they had to be added), while re.split doesn't so they have to be removed. [1] https://docs.python.org/3/library/stdtypes.html#str.splitlines
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+19 added−5 removed
- tests:+7 added−0 removed
- other:+12 added−5 removed