Let's introduce an autoescape template tag that will allow to control whether auto-escaping is enabled or disabled within a specific template block. This template tag would work as follows:
{% autoescape on %}
<!-- Auto-escaping is enabled -->
{% endautoescape %}
{% autoescape off %}
<!-- Auto-escaping is disabled -->
{% endautoescape %}
Coupled with the use of the escape template filter, this new template tag would allow to better accommodate situations where it's required to manually control what gets escaped versus what's not.
Description
Let's introduce an
autoescape
template tag that will allow to control whether auto-escaping is enabled or disabled within a specific template block. This template tag would work as follows:Coupled with the use of the
escape
template filter, this new template tag would allow to better accommodate situations where it's required to manually control what gets escaped versus what's not.