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

jinja2 lstrip_blocks behavior #892

Open
OmarTawfik opened this issue Jan 14, 2024 · 1 comment
Open

jinja2 lstrip_blocks behavior #892

OmarTawfik opened this issue Jan 14, 2024 · 1 comment

Comments

@OmarTawfik
Copy link

lstrip_blocks: If this is set to True leading spaces and tabs are stripped from the start of a line to a block. Defaults to False.
https://jinja.palletsprojects.com/en/3.1.x/api/

Code Example: https://ansiblemaster.wordpress.com/2016/07/29/jinja2-lstrip_blocks-to-manage-indentation/

It is very useful to be able to control/override indentation in for loops and if blocks, without having to dedent the template code, making it less readable. This is especially important for languages that indentation is actually semantically meaningful, like markdown or python.

I understand Tera doesn't support jinja2 environment variables, but I wonder if it is possible to support options like lstrip_blocks using another Tera-blessed way/using existing syntax?

@OmarTawfik OmarTawfik changed the title jinja2 lstrip_blocks jinja2 lstrip_blocks behavior Jan 14, 2024
@Keats
Copy link
Owner

Keats commented Jan 14, 2024

We could probably add that to tera2?

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

No branches or pull requests

2 participants