Skip to content
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

Stop concatenating spaces in templating logic. #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deekayen
Copy link

@deekayen deekayen commented Oct 3, 2022

The spaces before each template block are adding together to make the final product output file indenting excessive. Opting here for final readability instead of templating readability.

The spaces before each template block are adding together to make the final product output file indenting excessive. Opting here for final readability instead of templating readability.
@gardar
Copy link
Contributor

gardar commented Oct 6, 2022

I think the indenting in the template might be there to make the template easier to read.
It's a common practice to have the same indent level for the opening and closing tags of a jinja2 statement to be able to quickly realize where the statement begins/ends.
But I agree that it's definitely not something that should translate into the file that's generated from the template.

I wonder if the lstrip_blocks or trim_blocks parameters of the template module might fix the issue instead of removing the indentation from the template (and making it harder on the eyes).
It's also probably possible to fix the whitespace issue by using the minus sign ( {%- %} ) in some of the affected jinja2 statements, see: https://jinja.palletsprojects.com/en/3.0.x/templates/#whitespace-control

@bbaassssiiee
Copy link
Member

This branch has conflicts that must be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants