Closed JaapJoris closed 3 years ago
Jinja's {% raw %} tag disables parsing the containing block for template tags, as in the following example (taken from the documentation):
{% raw %}
{% raw %} <ul> {% for item in seq %} <li>{{ item }}</li> {% endfor %} </ul> {% endraw %}
DjHTML could support this by also disabling parsing the block for template tags. The result would then look like this:
However, the main use case of the {% raw %} tag is to present Jinja template tags themselves (in code blocks), and you could argue that:
<pre>
Since I'm at a loss here, I'm asking the Jinja community for help: How should the contents of a {% raw %} block be indented?
Whatever decision is made, I think the same should be made for Django's verbatim.
I have decided to go for the second option. Contents in {% raw %} and {% verbatim %} will now be left untouched by DjHTML.
{% verbatim %}
Jinja's
{% raw %}
tag disables parsing the containing block for template tags, as in the following example (taken from the documentation):DjHTML could support this by also disabling parsing the block for template tags. The result would then look like this:
However, the main use case of the
{% raw %}
tag is to present Jinja template tags themselves (in code blocks), and you could argue that:{% raw %}
tag at all){% raw %}
tag the same as a<pre>
tag.Since I'm at a loss here, I'm asking the Jinja community for help: How should the contents of a
{% raw %}
block be indented?