New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
White space U+000C FORM FEED in template not preserved #769
Comments
This problem still occurs with Jinja 2.10:
|
If this affects you and you can track it down, it would be helpful to see a patch or at least where the behavior is happening. I can't really say if it's intended or not without that, and I'd have to dig through the code myself to see. |
My attempts to track it down in a debugger session lead to code I can't inspect. The ‘Template.root_render_func’ turns out to not exist in the Jinja source code; maybe it's compiled from text at run time? I don't know how to track it further than that. |
Yes, you need to look at the parser/compiler, not the template code. You can ask Jinja to render the Python module instead of the final output and see what's going on. |
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: fixes pallets#769, pallets#952, pallets#1313 [1] https://docs.python.org/3/library/stdtypes.html#str.splitlines
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: fixes pallets#769, pallets#952, pallets#1313 [1] https://docs.python.org/3/library/stdtypes.html#str.splitlines
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: pallets#769, pallets#952, pallets#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
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: pallets#769, pallets#952, pallets#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
Expected Behavior
A template containing the white space character U+000C FORM FEED should render with that white space character preserved in the rendered output.
Actual Behavior
The U+000C character is removed and replaced with U+000A LINE FEED.
Environment
The text was updated successfully, but these errors were encountered: