File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -766,9 +766,9 @@ texts* and complex expressions:
766
766
767
767
Using the translation tags or filters have the same effect, but with
768
768
one subtle difference: automatic output escaping is only applied to
769
- variables translated using a filter. In other words, if you need to
770
- be sure that your translated variable is *not * output escaped, you must
771
- apply the raw filter after the translation filter:
769
+ translations using a filter. In other words, if you need to be sure
770
+ that your translated is *not * output escaped, you must apply the
771
+ `` raw `` filter after the translation filter:
772
772
773
773
.. code-block :: jinja
774
774
@@ -779,11 +779,9 @@ texts* and complex expressions:
779
779
780
780
{% set message = '<h3>foo</h3>' %}
781
781
782
- {# a variable translated via a filter is escaped by default #}
782
+ {# strings and variables translated via a filter is escaped by default #}
783
783
{{ message|trans|raw }}
784
-
785
- {# but static strings are never escaped #}
786
- {{ '<h3>foo</h3>'|trans }}
784
+ {{ '<h3>bar</h3>'|trans|raw }}
787
785
788
786
PHP Templates
789
787
~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments