]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Document the {%+ manual disable lstrip_blocks feature 139/head
authorKristi Tsukida <kristi.dev@gmail.com>
Thu, 12 Jul 2012 20:44:54 +0000 (13:44 -0700)
committerKristi Tsukida <kristi.dev@gmail.com>
Thu, 12 Jul 2012 20:44:54 +0000 (13:44 -0700)
docs/templates.rst

index ff7d5f738936da9d376232fa2e5fd118428d64e9..c1ae657a355c5bab3c86b81f19d67ce9de6e020d 100644 (file)
@@ -180,12 +180,20 @@ gets rendered with blank lines inside the div::
     
     </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::
     
     <div>
             yay
     </div>
 
+You can manually disable the `lstrip_blocks` behavior by putting a
+plus sign (``+``) at the start of a block::
+
+    <div>
+            {%+ if something %}yay{% endif %}
+    </div>
+
 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