From e4a74f9b9b76fc841e431123d91abcb5259ac747 Mon Sep 17 00:00:00 2001 From: Kristi Tsukida Date: Thu, 12 Jul 2012 13:44:54 -0700 Subject: [PATCH] Document the {%+ manual disable lstrip_blocks feature --- docs/templates.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/templates.rst b/docs/templates.rst index ff7d5f73..c1ae657a 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -180,12 +180,20 @@ gets rendered with blank lines inside the div:: -But with both `trim_blocks` and `lstrip_blocks` enabled, the lines with the template blocks are removed while preserving the whitespace of the contents:: +But with both `trim_blocks` and `lstrip_blocks` enabled, the lines with the +template blocks are removed while preserving the whitespace of the contents::
yay
+You can manually disable the `lstrip_blocks` behavior by putting a +plus sign (``+``) at the start of a block:: + +
+ {%+ if something %}yay{% endif %} +
+ You can also strip whitespace in templates by hand. If you put an minus sign (``-``) to the start or end of an block (for example a for tag), a comment or variable expression you can remove the whitespaces after or before -- 2.47.2