Skip to content

Add unindent() filter

Nikolai Kondrashov requested to merge spbnick/kpet:add_unindent_filter into main

Add the misc.unindent() function and expose it as the "unindent" filter to Jinja2 templates, in addition to (and replacing the use of) the "dedent" filter.

The "unindent" filter is replacing at most the whitespace seen in the first non-empty line of its input, as opposed to replacing the common whitespace done by the "dedent" filter. The former allows controlling the amount of removed whitespace more easily, and handling nested unindents, such as already-unindented macro substitutions.

Merge request reports