Skip to content

Fix Jinja whitespace control (#69821)#69822

Open
omolenkamp wants to merge 1 commit into
saltstack:masterfrom
omolenkamp:bugfix/69821-extra-newline-at-end-of-output-with-jinja-template
Open

Fix Jinja whitespace control (#69821)#69822
omolenkamp wants to merge 1 commit into
saltstack:masterfrom
omolenkamp:bugfix/69821-extra-newline-at-end-of-output-with-jinja-template

Conversation

@omolenkamp

Copy link
Copy Markdown

Salt sometimes adds unwanted trailing newlines when using Jinja templates. This is caused by the logic added in c123d8f, which isn't entirely correct in all cases.

Since Jinja introduced a configuration option keep_trailing_newline shortly after that change, which does the same except that it always works, drop the custom code from Salt and simply use the upstream option.

@omolenkamp
omolenkamp requested a review from a team as a code owner July 16, 2026 20:33

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but we'll need a changelog and a test

@omolenkamp
omolenkamp force-pushed the bugfix/69821-extra-newline-at-end-of-output-with-jinja-template branch from 2f15d84 to dd4e7c7 Compare July 17, 2026 20:08
@omolenkamp
omolenkamp requested a review from twangboy July 17, 2026 20:09
Salt sometimes adds unwanted trailing newlines when using Jinja
templates. This is caused by the logic added in c123d8f, which isn't
entirely correct in all cases.

Since Jinja introduced a configuration option `keep_trailing_newline`
shortly after that change, which does the same except that it always
works, drop the custom code from Salt and simply use the upstream
option.
@omolenkamp
omolenkamp force-pushed the bugfix/69821-extra-newline-at-end-of-output-with-jinja-template branch from dd4e7c7 to f20f200 Compare July 17, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants