Autoescape Overrides

Changelog

New in version 2.4.

If you want you can activate and deactivate Autoescaping from withina template.

Example:

  1. {% autoescape true %}
  2. Autoescaping is active within this block
  3. {% endautoescape %}
  4. {% autoescape false %}
  5. Autoescaping is inactive within this block
  6. {% endautoescape %}

After an endautoescape the behavior is reverted to what it was before.

Extension

In older versions of Jinja (before 2.9) it was required to enable thisfeature with an extension. It’s now enabled by default.