mozilla / nunjucks

A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)
https://mozilla.github.io/nunjucks/
BSD 2-Clause "Simplified" License
8.48k stars 634 forks source link

Block assignment filters do not work #1422

Open dhruvkb opened 1 year ago

dhruvkb commented 1 year ago

Jinja supports block assignment since v2.8 and block assignment filters since v2.10. The latter is missing from Nunjucks and should be supported.

For example, the template below

{% set content | indent(2, true) %}
This is some text

and this is some text
{% endset %}
{{ content }}

when rendering, raises the error

Uncaught:
Template render error: (unknown path) [Line 1, Column 4]
  parseSet: expected = or block end in set tag