Open LeaVerou opened 2 days ago
To add to @LeaVerou's comment, if we move {% set page_content = 'foobar' %}
inside the call
block, it produces the expected result:
{% macro page() %}
<section class="page">
{{ caller() | safe }}
</section>
{% endmacro %}
{% macro test_page() %}
{% call page() -%}
{% set page_content = 'foobar' %}
{{ page_content | safe }}
{%- endcall %}
{% endmacro %}
{{ test_page() | safe }}
Sorry for the poor description, I couldn’t figure out a better one.
Testcase:
Should produce:
Instead produces:
Jinja2 gets it right btw.