-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
rendering nested block broken by if-else-endif in outer block #1075
Comments
Can you check if #1054 fixes this problem for you? |
Looks like this also triggers the same bug with just if-endif twice in the same row: {% extends "fragment-base.html" %}
{% block body %}
<p>Don't render me!</p>
{%- if true -%}
true
{%- endif -%}{%- if false -%}
false
{%- endif -%}
{% block nested %}
<p>I should be here.</p>
{% endblock %}
{% endblock %}
{% block other_body %}
<p>Don't render me!</p>
{% endblock %} |
Would you mind submitting a PR adding this as an integration test? I plan to carve out some time to work on this soon. |
Thanks for all your efforts, will try to look into this issue soon! (Currently on vacation so might take me a few weeks.) |
Enjoy your vacation, open source can wait :) |
I have been digging at the code a bit. What may contribute here is that in some cases, |
Description
When rendering a nested block as a fragment, an if-else-endif clause in the outer block causes this error message:
It does not occur when the same template is rendered as a whole. It does not occur if only a if-endif clause is used.
Environment
askama main from Git (382b5f6)
How to reproduce
I created a small patch to the test suite: clonejo@96e0fb0
testing/templates/fragment-nested-block.html
:The text was updated successfully, but these errors were encountered: