Skip to content

Commit 3dfcf16

Browse files
Herzultweaverryan
authored andcommitted
Update use of Twig filters to fit coding standards
See http://twig.sensiolabs.org/doc/coding_standards.html
1 parent 9a478cd commit 3dfcf16

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

book/templating.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ it:
9090

9191
.. code-block:: jinja
9292
93-
{{ title | upper }}
93+
{{ title|upper }}
9494
9595
Twig comes with a long list of `tags`_ and `filters`_ that are available
9696
by default. You can even `add your own extensions`_ to Twig as needed.
@@ -1120,7 +1120,7 @@ In some cases, you'll need to disable output escaping when you're rendering
11201120
a variable that is trusted and contains markup that should not be escaped.
11211121
Suppose that administrative users are able to write articles that contain
11221122
HTML code. By default, Twig will escape the article body. To render it normally,
1123-
add the ``raw`` filter: ``{{ article.body | raw }}``.
1123+
add the ``raw`` filter: ``{{ article.body|raw }}``.
11241124

11251125
You can also disable output escaping inside a ``{% block %}`` area or
11261126
for an entire template. For more information, see `Output Escaping`_ in

book/translation.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,13 @@ texts* and complex expressions:
745745

746746
.. code-block:: jinja
747747
748-
{{ message | trans }}
748+
{{ message|trans }}
749749
750-
{{ message | transchoice(5) }}
750+
{{ message|transchoice(5) }}
751751
752-
{{ message | trans({'%name%': 'Fabien'}, "app") }}
752+
{{ message|trans({'%name%': 'Fabien'}, "app") }}
753753
754-
{{ message | transchoice(5, {'%name%': 'Fabien'}, 'app') }}
754+
{{ message|transchoice(5, {'%name%': 'Fabien'}, 'app') }}
755755
756756
.. tip::
757757

@@ -771,10 +771,10 @@ texts* and complex expressions:
771771
{% set message = '<h3>foo</h3>' %}
772772
773773
{# a variable translated via a filter is escaped by default #}
774-
{{ message | trans | raw }}
774+
{{ message|trans|raw }}
775775
776776
{# but static strings are never escaped #}
777-
{{ '<h3>foo</h3>' | trans }}
777+
{{ '<h3>foo</h3>'|trans }}
778778
779779
PHP Templates
780780
~~~~~~~~~~~~~

0 commit comments

Comments
 (0)