From 4f8e3774bba0f63d98e651ef044d6703792921a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Tue, 7 Apr 2026 14:40:33 +0200 Subject: [PATCH] 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). --- bin/tests/system/isctest/template.py | 2 ++ bin/tests/system/xfer/ns8/small.db.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/isctest/template.py b/bin/tests/system/isctest/template.py index 8065f4acbb..21cc811dfb 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 c2c098fca9..90db2db2ad 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 %}