File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -202,27 +202,33 @@ option can also be set to strip tabs and spaces from the beginning of a
202
202
line to the start of a block. (Nothing will be stripped if there are
203
203
other characters before the start of the block.)
204
204
205
- With both `trim_blocks ` and `lstrip_blocks ` enabled, you can put block tags
206
- on their own lines, and the entire block line will be removed when
207
- rendered, preserving the whitespace of the contents. For example,
208
- without the `trim_blocks ` and `lstrip_blocks ` options, this template::
205
+ With both ``trim_blocks `` and ``lstrip_blocks `` disabled (the default), block
206
+ tags on their own lines will be removed, but a blank line will remain and the
207
+ spaces in the content will be preserved. For example, this template:
208
+
209
+ .. code-block :: jinja
209
210
210
211
<div>
211
212
{% if True %}
212
213
yay
213
214
{% endif %}
214
215
</div>
215
216
216
- gets rendered with blank lines inside the div::
217
+ With both ``trim_blocks `` and ``lstrip_blocks `` disabled, the template is
218
+ rendered with blank lines inside the div:
219
+
220
+ .. code-block :: text
217
221
218
222
<div>
219
223
220
224
yay
221
225
222
226
</div>
223
227
224
- But with both `trim_blocks ` and `lstrip_blocks ` enabled, the template block
225
- lines are removed and other whitespace is preserved::
228
+ With both ``trim_blocks `` and ``lstrip_blocks `` enabled, the template block
229
+ lines are completely removed:
230
+
231
+ .. code-block :: text
226
232
227
233
<div>
228
234
yay
You can’t perform that action at this time.
0 commit comments