flask - Escape jinja2 syntax in a jinja2 template -
i serve dynamic pages jinja2 templates in flask. defining client-side templates in say, jinja2-clone nunjucks inside script tag. problem is, client-side templates has syntax <% %>
flask's jinja2 interpreter may interpret instead of rendering verbatim.
how can make entire block of scripts render verbatim?
you can disable interpretation of tags inside {% raw %}
block:
{% raw %} in block treated raw text, including {{ curly braces }} , {% other block-like syntax %} {% endraw %}
see escaping section of template documentation.
Comments
Post a Comment