Browse code

Merge branch '1.x' into 2.x

* 1.x:
Update doc with new escaping behavior
Remove obsolete page
language typo

Fabien Potencier authored on 28/12/2019 07:09:20
Showing 3 changed files
... ...
@@ -14,7 +14,6 @@
14 14
         },
15 15
         {
16 16
             "name": "Twig Team",
17
-            "homepage": "https://twig.symfony.com/contributors",
18 17
             "role": "Contributors"
19 18
         },
20 19
         {
... ...
@@ -399,7 +399,7 @@ The escaping rules are implemented as follows:
399 399
         {% set text = "Twig<br />" %}
400 400
         {{ text }} {# will be escaped #}
401 401
 
402
-* Expressions which the result is always a literal or a variable marked safe
402
+* Expressions which the result is a literal or a variable marked safe
403 403
   are never automatically escaped:
404 404
 
405 405
   .. code-block:: twig
... ...
@@ -407,14 +407,12 @@ The escaping rules are implemented as follows:
407 407
         {{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
408 408
 
409 409
         {% set text = "Twig<br />" %}
410
-        {{ foo ? text : "<br />Twig" }} {# will be escaped #}
410
+        {{ true ? text : "<br />Twig" }} {# will be escaped #}
411
+        {{ false ? text : "<br />Twig" }} {# won't be escaped #}
411 412
 
412 413
         {% set text = "Twig<br />" %}
413 414
         {{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
414 415
 
415
-        {% set text = "Twig<br />" %}
416
-        {{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
417
-
418 416
 * Objects with a ``__toString`` method are converted to strings and
419 417
   escaped. You can mark some classes and/or interfaces as being safe for some
420 418
   strategies via ``EscaperExtension::addSafeClass()``:
... ...
@@ -2,7 +2,7 @@
2 2
 ===========
3 3
 
4 4
 ``same as`` checks if a variable is the same as another variable.
5
-This is the equivalent to ``===`` in PHP:
5
+This is equivalent to ``===`` in PHP:
6 6
 
7 7
 .. code-block:: twig
8 8