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

Indent filter does not ignore empty lines #1421

Open
dhruvkb opened this issue Nov 22, 2022 · 0 comments · May be fixed by #1425
Open

Indent filter does not ignore empty lines #1421

dhruvkb opened this issue Nov 22, 2022 · 0 comments · May be fixed by #1425

Comments

@dhruvkb
Copy link

dhruvkb commented Nov 22, 2022

When using the indent filter on a block, empty lines are also indented. This is a divergence between Jinja and Nunjucks behaviour and should be addressed.

For example, the template below

{% set content %}
This is some text

and this is some more text.
{% endset %}
{% set content = content | indent(2, true) %}
{{ content }}

when rendered produces

..This is some text
..
..and this is some more text.

instead of

..This is some text

..and this is some more text.

Jinja issue: pallets/jinja#681
Jinja PR: pallets/jinja#685

@NikolaDojic NikolaDojic linked a pull request Dec 3, 2022 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

1 participant