diff options
author | Matěj Volf <mat.volfik@gmail.com> | 2021-03-09 14:19:58 +0100 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-04-05 11:46:36 -0700 |
commit | 9dae67bcc8dbc389e0ceef12f1fa04352ef75b8e (patch) | |
tree | b7c6ce202b0302fcd5533b419fb8660071ce297b /CHANGES.rst | |
parent | 59de6fbde98de6719758b773a77f0559756756b5 (diff) | |
download | jinja2-9dae67bcc8dbc389e0ceef12f1fa04352ef75b8e.tar.gz |
Split lines in lexer only by \r\n, \r and \n
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
Diffstat (limited to 'CHANGES.rst')
-rw-r--r-- | CHANGES.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index dad0d0e..dd3739f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -56,6 +56,8 @@ Unreleased instead of a ``TypeError``. :issue:`1198` - ``Undefined`` is iterable in an async environment. :issue:`1294` - ``NativeEnvironment`` supports async mode. :issue:`1362` +- Template rendering only treats ``\n``, ``\r\n`` and ``\r`` as line + breaks. Other characters are left unchanged. :issue:`769, 952, 1313` Version 2.11.3 |