[bug] for loop `else` doesn't strip whitespaces
The whitespace markers {%- and -%} around for and endfor strip whitespace correctly, but not else:
{%- for x in y -%} // picked up before/after
{%- else -%} // useless/ignored
{%- endfor -%} // picked up before/after
Probably already works in v2 but I'll have to add it as a testcase
@Keats the bug exists in the latest published 1.19.0. Given that v2 has no expected release date/still WIP, do you think it is possible to fix it in v1 in the meantime?
If someone does a PR sure
What does else in a for loop do, just out of curiosity?
@schungx https://keats.github.io/tera/docs/#for
Lastly, you can set a default body to be rendered when the container is empty:
{% for product in products %}
{{loop.index}}.{{product.name}}
{% else %}
No products.
{% endfor %}
Duplicate of #862?