Add keep_trailing_newline to configure final endline stripping#170
Merged
mitsuhiko merged 1 commit intopallets:masterfrom May 19, 2013
Merged
Add keep_trailing_newline to configure final endline stripping#170mitsuhiko merged 1 commit intopallets:masterfrom
keep_trailing_newline to configure final endline stripping#170mitsuhiko merged 1 commit intopallets:masterfrom
Conversation
This option defaults to False for compatibility with the existing behaviour. I've added the option because I expect I won't remember to keep an extra trailing newline in my templates, and some non-HTML templates *need* that last newline. See also: https://groups.google.com/d/msg/pocoo-libs/6DylMqq1voI/GXTbZJ1Tr-sJ
|
a 👍 I'm also interested in that. |
Contributor
Author
|
Since there's a lot of Jinja work going on at the moment, maybe someone can merge this? :D. |
|
Is it intentional/expected that For example, I have a template file that has a trailing newline: When it gets rendered, the newline is removed: When rendering with But if I pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This option defaults to False for compatibility with the existing behaviour.
I've added the option because I expect I won't remember to keep an extra
trailing newline in my templates, and some non-HTML templates need that last
newline.
See also: https://groups.google.com/d/msg/pocoo-libs/6DylMqq1voI/GXTbZJ1Tr-sJ
On 2011-02-28, Armin Ronacher wrote:
Here's the flag, all done up with a bow and a unittest ;).