Skip to content
Myr

Improve whitespace docs to reflect reality.

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

See also: https://groups.google.com/d/msg/pocoo-libs/6DylMqq1voI/GXTbZJ1Tr-sJ

authored by Paul McMillan · committed by Paul McMillan · parent a21f2ed · Browse files · 1 file+5 added−4 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+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:docs/templates.rst+5 added-4 removed
150 unmodified lines
151152Whitespace Control153------------------154155In the default configuration whitespace is not further modified by the156template engine, so each whitespace (spaces, tabs, newlines etc.) is returned157unchanged. If the application configures Jinja to `trim_blocks` the first158newline after a a template tag is removed automatically (like in PHP).155In the default configuration, a single trailing newline is stripped if156present, and whitespace is not further modified by the template engine. Each157whitespace (spaces, tabs, newlines etc.) is returned unchanged. If the158application configures Jinja to `trim_blocks` the first newline after a a159template tag is removed automatically (like in PHP).160161But you can also strip whitespace in templates by hand. If you put an minus162sign (``-``) to the start or end of an block (for example a for tag), a163comment or variable expression you can remove the whitespaces after or before
1218 unmodified lines