Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
* 1.x:
  Update doc with new escaping behavior
  Remove obsolete page
  language typo
  • Loading branch information
fabpot committed Dec 28, 2019
2 parents 7f75a23 + 8236277 commit e74a51e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -14,7 +14,6 @@
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
Expand Down
8 changes: 3 additions & 5 deletions doc/api.rst
Expand Up @@ -399,22 +399,20 @@ 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
{{ 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()``:
Expand Down
2 changes: 1 addition & 1 deletion doc/tests/sameas.rst
Expand Up @@ -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
Expand Down

0 comments on commit e74a51e

Please sign in to comment.