I have a base template that uses {% autoescape false %} around a block because the contents of that particular block are used in a plaintext context that does not need escaping, while the rest of the template does.
However, when override that block in the main template, autoescaping still happens - see test1 in the output below.
test2 is completely weird and makes no sense at all - wrapping the block in autoescape should have no effect whatsoever (since nothing outside of blocks should be taken into account in a template that uses {% extends %}.
test3 has the desired result, but at the cost of having to duplicate the autoescape false block in each child template, which is exactly what I'm trying to avoid.
Description
I have a base template that uses
{% autoescape false %}
around a block because the contents of that particular block are used in a plaintext context that does not need escaping, while the rest of the template does.However, when override that block in the main template, autoescaping still happens - see
test1
in the output below.test2
is completely weird and makes no sense at all - wrapping the block in autoescape should have no effect whatsoever (since nothing outside of blocks should be taken into account in a template that uses{% extends %}
.test3
has the desired result, but at the cost of having to duplicate theautoescape false
block in each child template, which is exactly what I'm trying to avoid.Example
Output
Environment