Skip to content

Commit 058e059

Browse files
authored
fix boolean error about whitespace control (#1819)
2 parents da67299 + 9c3622c commit 058e059

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/templates.rst

+13-7
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,33 @@ option can also be set to strip tabs and spaces from the beginning of a
202202
line to the start of a block. (Nothing will be stripped if there are
203203
other characters before the start of the block.)
204204

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
209210
210211
<div>
211212
{% if True %}
212213
yay
213214
{% endif %}
214215
</div>
215216
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
217221
218222
<div>
219223
220224
yay
221225
222226
</div>
223227
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
226232
227233
<div>
228234
yay

0 commit comments

Comments
 (0)