File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -416,22 +416,20 @@ The escaping rules are implemented as follows:
416
416
{% set text = "Twig<br />" %}
417
417
{{ text }} {# will be escaped #}
418
418
419
- * Expressions which the result is always a literal or a variable marked safe
419
+ * Expressions which the result is a literal or a variable marked safe
420
420
are never automatically escaped:
421
421
422
422
.. code-block :: twig
423
423
424
424
{{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
425
425
426
426
{% set text = "Twig<br />" %}
427
- {{ foo ? text : "<br />Twig" }} {# will be escaped #}
427
+ {{ true ? text : "<br />Twig" }} {# will be escaped #}
428
+ {{ false ? text : "<br />Twig" }} {# won't be escaped #}
428
429
429
430
{% set text = "Twig<br />" %}
430
431
{{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
431
432
432
- {% set text = "Twig<br />" %}
433
- {{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
434
-
435
433
* Escaping is applied before printing, after any other filter is applied:
436
434
437
435
.. code-block :: twig
You can’t perform that action at this time.
0 commit comments