From 6b0122768f2a5a1decba592e1758dba3c17abcf4 Mon Sep 17 00:00:00 2001 From: Amy Date: Wed, 17 Jun 2020 14:12:57 -0400 Subject: ignore trim_blocks using '+%}' --- docs/templates.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs') diff --git a/docs/templates.rst b/docs/templates.rst index a346ef23..3101d0ed 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -230,6 +230,15 @@ plus sign (``+``) at the start of a block:: {%+ if something %}yay{% endif %} +Similarly, you can manually disable the ``trim_blocks`` behavior by +putting a plus sign (``+``) at the end of a block:: + +
+ {% if something +%} + yay + {% endif %} +
+ You can also strip whitespace in templates by hand. If you add a minus sign (``-``) to the start or end of a block (e.g. a :ref:`for-loop` tag), a comment, or a variable expression, the whitespaces before or after -- cgit v1.2.3