4 The ``raw`` filter marks the value as being "safe", which means that in an
5 environment with automatic escaping enabled this variable will not be escaped
6 if ``raw`` is the last filter applied to it:
11 {{ var|raw }} {# var won't be escaped #}
16 Be careful when using the ``raw`` filter inside expressions:
21 {% set hello = '<strong>Hello</strong>' %}
22 {% set hola = '<strong>Hola</strong>' %}
24 {{ false ? '<strong>Hola</strong>' : hello|raw }}
25 does not render the same as
26 {{ false ? hola : hello|raw }}
27 but renders the same as
28 {{ (false ? hola : hello)|raw }}
31 The first ternary statement is not escaped: ``hello`` is marked as being
32 safe and Twig does not escape static values (see
33 :doc:`escape<../tags/autoescape>`). In the second ternary statement, even
34 if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole
35 expression. The third ternary statement is marked as safe and the result is