Skip to content
Myr

Document the {%+ manual disable lstrip_blocks feature

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kristi Tsukida · committed by Kristi Tsukida · parent 523efbd · Browse files · 1 file+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−1 removed

  • other:+9 added−1 removed

1 file+9 added−1 removed

modified:docs/templates.rst+9 added-1 removed
178 unmodified lines
179 yay180 181 </div>182183But with both `trim_blocks` and `lstrip_blocks` enabled, the lines with the template blocks are removed while preserving the whitespace of the contents::183But with both `trim_blocks` and `lstrip_blocks` enabled, the lines with the 184template blocks are removed while preserving the whitespace of the contents::185 186 <div>187 yay188 </div>189190You can manually disable the `lstrip_blocks` behavior by putting a191plus sign (``+``) at the start of a block::192193 <div>194 {%+ if something %}yay{% endif %}195 </div>196197You can also strip whitespace in templates by hand. If you put an minus198sign (``-``) to the start or end of an block (for example a for tag), a199comment or variable expression you can remove the whitespaces after or before200that block::
1217 unmodified lines