From: Nicki Křížek Date: Tue, 7 Apr 2026 12:40:33 +0000 (+0200) Subject: Reduce whitespace in jinja2 templates X-Git-Tag: v9.21.23~29^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f8e3774bba0f63d98e651ef044d6703792921a2;p=thirdparty%2Fbind9.git Reduce whitespace in jinja2 templates Omit extra newlines when combining and including templates. Adjust the xfer/ns8/small.db.j2 so it doesn't trim the endline twice (as that would join the two subsequent records on the same line). --- diff --git a/bin/tests/system/isctest/template.py b/bin/tests/system/isctest/template.py index 8065f4acbbd..21cc811dfb6 100644 --- a/bin/tests/system/isctest/template.py +++ b/bin/tests/system/isctest/template.py @@ -44,6 +44,8 @@ class TemplateEngine: undefined=jinja2.StrictUndefined, variable_start_string="@", variable_end_string="@", + trim_blocks=True, + keep_trailing_newline=True, ) # allow instantiating the template dataclasses in jinja2 templates when # using {% set %} diff --git a/bin/tests/system/xfer/ns8/small.db.j2 b/bin/tests/system/xfer/ns8/small.db.j2 index c2c098fca93..90db2db2ad6 100644 --- a/bin/tests/system/xfer/ns8/small.db.j2 +++ b/bin/tests/system/xfer/ns8/small.db.j2 @@ -1,4 +1,4 @@ {% for i in range(4096) %} name@i@ 259200 A 1.2.3.4 name@i@ 259200 TXT "Hello World @i@" -{%- endfor %} \ No newline at end of file +{% endfor %}