]> git.ipfire.org Git - thirdparty/jinja.git/commit
filters.py: do_indent: ident filter can indent with arbitrary characters 1167/head
authorLars Kollstedt <lk@man-da.de>
Tue, 10 Mar 2020 11:26:44 +0000 (12:26 +0100)
committerDavid Lord <davidism@gmail.com>
Mon, 5 Apr 2021 16:50:45 +0000 (09:50 -0700)
commit8016b5f139473675ace9a5a1eb845298335e9dd2
treee6647b3929df3a376aec6546fb15cee486742205
parent7bea9193f48b6f8fac147ace7ca349a05e594af4
filters.py: do_indent: ident filter can indent with arbitrary characters

Allow indention with generic characters, e.g. Tabs.

Implemenented the behavior requested in
https://github.com/pallets/jinja/pull/1167#issuecomment-612644701

The width param can be string or int, if it is string it's the raw
indention e.g. "\t". If it's int it's the number of spaces. In other
cases an FilterArgumentError is raised, to avoid confusion.
CHANGES.rst
src/jinja2/filters.py
tests/test_filters.py