Skip to content

Commit 4ee48fa

Browse files
pwilkinCISC
andauthored
Update scripts/jinja/jinja-tester.py
Co-authored-by: Sigbjørn Skjæret <[email protected]>
1 parent ca6e899 commit 4ee48fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/jinja/jinja-tester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def format_template_content(template_content):
2828
return template_content
2929

3030
env = ImmutableSandboxedEnvironment()
31-
tokens = list(env.lex(template_content))
31+
tc_rstrip = template_content.rstrip()
32+
tokens = list(env.lex(tc_rstrip))
3233
result = ""
3334
indent_level = 0
3435
i = 0
@@ -146,7 +147,6 @@ def format_template_content(template_content):
146147
result = result.rstrip()
147148

148149
# Copy the newline / space count from the original
149-
tc_rstrip = template_content.rstrip()
150150
if (trailing_length := len(template_content) - len(tc_rstrip)):
151151
result += template_content[-trailing_length:]
152152

0 commit comments

Comments
 (0)