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 @@ -757,9 +757,9 @@ texts* and complex expressions:
757
757
758
758
Using the translation tags or filters have the same effect, but with
759
759
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:
763
763
764
764
.. code-block :: jinja
765
765
@@ -770,11 +770,9 @@ texts* and complex expressions:
770
770
771
771
{% set message = '<h3>foo</h3>' %}
772
772
773
- {# a variable translated via a filter is escaped by default #}
773
+ {# strings and variables translated via a filter is escaped by default #}
774
774
{{ message|trans|raw }}
775
-
776
- {# but static strings are never escaped #}
777
- {{ '<h3>foo</h3>'|trans }}
775
+ {{ '<h3>bar</h3>'|trans|raw }}
778
776
779
777
PHP Templates
780
778
~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments