From: Kristi Tsukida Date: Thu, 12 Jul 2012 20:44:54 +0000 (-0700) Subject: Document the {%+ manual disable lstrip_blocks feature X-Git-Tag: 2.7~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4a74f9b9b76fc841e431123d91abcb5259ac747;p=thirdparty%2Fjinja.git Document the {%+ manual disable lstrip_blocks feature --- 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