]> git.ipfire.org Git - thirdparty/jinja.git/commit
let wordwrap filter respect existing newlines
authorFlorian Heinle <florian.heinle@makandra.de>
Thu, 7 Sep 2017 09:21:11 +0000 (11:21 +0200)
committerDavid Lord <davidism@gmail.com>
Fri, 1 Nov 2019 14:56:03 +0000 (07:56 -0700)
commit4e7e45ab35db5ef68fc52b0ba936f12ad49cd12a
tree721196113177ca55ee202c029a2edaf62e320ae1
parent5dcc676e88997352a8b1b5fbd7aa6b6f3bd1ee4f
let wordwrap filter respect existing newlines

textwrap.wrap() has unexpected behaviour where when wrapping multiple
paragraphs it will not consider existing newlines.

I.e. when your first paragraph ends on col 75, the next paragraph
will be wrapped on col 5 already.

This patch is wrapping each line individually and combining it back
together.
jinja2/filters.py