.. note::
- Be careful when using the ``raw`` filter inside expressions. This
- snippet illustrates a case that can be confusing :
+ Be careful when using the ``raw`` filter inside expressions:
.. code-block:: jinja
{{ (false ? hola : hello)|raw }}
{% endautoescape %}
- The first ternary won't be escaped : ``hello`` is marked as being safe and
- Twig does not escape static values (see :doc:`escape<../tags/autoescape>`).
- In the second ternary, even if ``hello`` is marked as safe, ``hola``
- remains unsafe and so will be the whole expression. On the other hand, the
- third ternary will be marked as safe and the result won't be escaped.
\ No newline at end of file
+ The first ternary statement is not escaped: ``hello`` is marked as being
+ safe and Twig does not escape static values (see
+ :doc:`escape<../tags/autoescape>`). In the second ternary statement, even
+ if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole
+ expression. The third ternary statement is marked as safe and the result is
+ not escaped.
.. note::
- Twig does not escape static expressions :
+ Twig does not escape static expressions:
.. code-block:: jinja
Will be rendered "<strong>Hello</strong> **world**".
-
.. note::
The chapter :doc:`Twig for Developers<../api>` gives more information
- about when and how automatic escaping is applied.
\ No newline at end of file
+ about when and how automatic escaping is applied.