Skip to content

Let wordwrap filter respect existing newlines#766

Merged
davidism merged 2 commits intopallets:masterfrom
very-emmazing:palletes_jinja_175-wordwrap
Nov 1, 2019
Merged

Let wordwrap filter respect existing newlines#766
davidism merged 2 commits intopallets:masterfrom
very-emmazing:palletes_jinja_175-wordwrap

Conversation

@very-emmazing
Copy link
Copy Markdown

textwrap.wrap() from stdlib 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.

Fixes #175.

@dwt

This comment has been minimized.

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.
@davidism davidism added this to the 2.11.0 milestone Nov 1, 2019
@davidism davidism merged commit 881c56b into pallets:master Nov 1, 2019
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wordwrap filter ignores existing newlines

4 participants