Skip to content

Commit 15a00d9

Browse files
committed
Fixed output escaping issues
1 parent a3043db commit 15a00d9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

book/translation.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ texts* and complex expressions:
757757

758758
Using the translation tags or filters have the same effect, but with
759759
one subtle difference: automatic output escaping is only applied to
760-
variables translated using a filter. In other words, if you need to
761-
be sure that your translated variable is *not* output escaped, you must
762-
apply the raw filter after the translation filter:
760+
translations using a filter. In other words, if you need to be sure
761+
that your translated is *not* output escaped, you must apply the
762+
``raw`` filter after the translation filter:
763763

764764
.. code-block:: jinja
765765
@@ -770,11 +770,9 @@ texts* and complex expressions:
770770
771771
{% set message = '<h3>foo</h3>' %}
772772
773-
{# a variable translated via a filter is escaped by default #}
773+
{# strings and variables translated via a filter is escaped by default #}
774774
{{ message|trans|raw }}
775-
776-
{# but static strings are never escaped #}
777-
{{ '<h3>foo</h3>'|trans }}
775+
{{ '<h3>bar</h3>'|trans|raw }}
778776
779777
PHP Templates
780778
~~~~~~~~~~~~~

0 commit comments

Comments
 (0)