We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de41400 commit ca6e899Copy full SHA for ca6e899
scripts/jinja/jinja-tester.py
@@ -147,11 +147,8 @@ def format_template_content(template_content):
147
148
# Copy the newline / space count from the original
149
tc_rstrip = template_content.rstrip()
150
- if not tc_rstrip.endswith("-%}") and not tc_rstrip.endswith(r'-}}'):
151
- # If orig ends with -%} or -}}, that means all newlines are stripped anyways
152
- # So we shouldn't add anything
153
- trailing_length = len(template_content) - len(tc_rstrip)
154
- result += template_content[:-trailing_length]
+ if (trailing_length := len(template_content) - len(tc_rstrip)):
+ result += template_content[-trailing_length:]
155
156
return result
157
0 commit comments