A filter block that mixes input-marked text with | safe input-marked text escapes all of it before the filter runs. So the safe part comes out escaped and the filter sees escaped text.
With x = JinjaString.user('<b>'):
{% filter upper %}{{ x }}{{ x | safe }}{% endfilter %}
- Actual:
<B><B>
- Expected:
<B><B>. The filter should see raw text, the marked part should be escaped once at output, and the safe part should stay raw.
Blocks that are all input or all safe work since #34. A mixed block needs the safe flag tracked per output part, not per value.
Accepted as a known limitation in #34.
A filter block that mixes input-marked text with
| safeinput-marked text escapes all of it before the filter runs. So the safe part comes out escaped and the filter sees escaped text.With
x = JinjaString.user('<b>'):<B><B><B><B>. The filter should see raw text, the marked part should be escaped once at output, and the safe part should stay raw.Blocks that are all input or all safe work since #34. A mixed block needs the safe flag tracked per output part, not per value.
Accepted as a known limitation in #34.