diff options
author | Amy <leiamy12@gmail.com> | 2020-06-17 14:12:57 -0400 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2020-06-22 10:21:47 -0700 |
commit | 6b0122768f2a5a1decba592e1758dba3c17abcf4 (patch) | |
tree | 2046b95d53a74b793dd54b7ea6e1b86724b93435 /docs | |
parent | 9b718ed3d26fc2f80ab58f3249b517a65db9cc7b (diff) | |
download | jinja-6b0122768f2a5a1decba592e1758dba3c17abcf4.tar.gz |
ignore trim_blocks using '+%}'
Diffstat (limited to 'docs')
-rw-r--r-- | docs/templates.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/templates.rst b/docs/templates.rst index a346ef23..3101d0ed 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -230,6 +230,15 @@ plus sign (``+``) at the start of a block:: {%+ if something %}yay{% endif %} </div> +Similarly, you can manually disable the ``trim_blocks`` behavior by +putting a plus sign (``+``) at the end of a block:: + + <div> + {% if something +%} + yay + {% endif %} + </div> + You can also strip whitespace in templates by hand. If you add a minus sign (``-``) to the start or end of a block (e.g. a :ref:`for-loop` tag), a comment, or a variable expression, the whitespaces before or after |