Merge branch '1.x' into 2.x

* 1.x:
  Update doc with new escaping behavior
  Remove obsolete page
  language typo
This commit is contained in:
Fabien Potencier
2019-12-28 08:09:20 +01:00
3 changed files with 4 additions and 7 deletions
-1
View File
@@ -14,7 +14,6 @@
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
+3 -5
View File
@@ -399,7 +399,7 @@ The escaping rules are implemented as follows:
{% set text = "Twig<br />" %}
{{ 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
@@ -407,14 +407,12 @@ The escaping rules are implemented as follows:
{{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text : "<br />Twig" }} {# will be escaped #}
{{ true ? text : "<br />Twig" }} {# will be escaped #}
{{ false ? text : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
{% set text = "Twig<br />" %}
{{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
* Objects with a ``__toString`` method are converted to strings and
escaped. You can mark some classes and/or interfaces as being safe for some
strategies via ``EscaperExtension::addSafeClass()``:
+1 -1
View File
@@ -2,7 +2,7 @@
===========
``same as`` checks if a variable is the same as another variable.
This is the equivalent to ``===`` in PHP:
This is equivalent to ``===`` in PHP:
.. code-block:: twig