--TEST--
"autoescape" tag handles filters preserving the safety
--TEMPLATE--
{% autoescape 'html' %}
(preserves_safety is preserving safety for "html")
1. Unsafe values are still unsafe
( var|preserves_safety|escape )
{{ var|preserves_safety }}
2. Safe values are still safe
( var|escape|preserves_safety )
{{ var|escape|preserves_safety }}
3. Re-escape values that are escaped for an other contexts
( var|escape_something|preserves_safety|escape )
{{ var|escape_something|preserves_safety }}
4. Still escape when using filters not declared safe
( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }}
{% endautoescape %}
--DATA--
return array('var' => "<Fabien>\nTwig")
--EXPECT--
(preserves_safety is preserving safety for "html")
1. Unsafe values are still unsafe
( var|preserves_safety|escape )
<FABIEN>
TWIG
2. Safe values are still safe
( var|escape|preserves_safety )
<FABIEN>
TWIG
3. Re-escape values that are escaped for an other contexts
( var|escape_something|preserves_safety|escape )
<FABIEN>
TWIG
4. Still escape when using filters not declared safe
( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
&LT;FABPOT&GT;
TWIG
|