From 92e1cd35c5591359a04f24ce1082f59825b5cade Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Sun, 22 Dec 2019 09:16:04 +0100 Subject: [PATCH] Update doc with new escaping behavior When applied on ternary statements --- doc/api.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 8dc1f2a763..40ccd6992e 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -416,7 +416,7 @@ The escaping rules are implemented as follows: {% set text = "Twig
" %} {{ text }} {# will be escaped #} -* Expressions which the result is always a literal or a variable marked safe +* Expressions which the result is a literal or a variable marked safe are never automatically escaped: .. code-block:: twig @@ -424,14 +424,12 @@ The escaping rules are implemented as follows: {{ foo ? "Twig
" : "
Twig" }} {# won't be escaped #} {% set text = "Twig
" %} - {{ foo ? text : "
Twig" }} {# will be escaped #} + {{ true ? text : "
Twig" }} {# will be escaped #} + {{ false ? text : "
Twig" }} {# won't be escaped #} {% set text = "Twig
" %} {{ foo ? text|raw : "
Twig" }} {# won't be escaped #} - {% set text = "Twig
" %} - {{ foo ? text|escape : "
Twig" }} {# the result of the expression won't be escaped #} - * Escaping is applied before printing, after any other filter is applied: .. code-block:: twig