ansible-community / antsibull-build

Tooling for building various things related to ansible
GNU General Public License v3.0
60 stars 31 forks source link

announcements: add missing newline before before heading #589

Closed gotmax23 closed 7 months ago

gotmax23 commented 7 months ago

We have trim_blocks enabled in the Jinja environment, so we need an extra newline here.

webknjaz commented 7 months ago

@gotmax23 does this leave one LF in the end? I'm always confused by how Jinja squashes stuff with those trims left and right.. I also need to figure out a related problem elsewhere...

gotmax23 commented 7 months ago

@gotmax23 does this leave one LF in the end? I'm always confused by how Jinja squashes stuff with those trims left and right.. I also need to figure out a related problem elsewhere...

trim_blocks removes a newline immediately following the end of a block. {% endif %} ends off the line so we need an extra newline to have one blank line before the heading, as the first newline is stripped out. You can see what it looks like in the test_data files that I just regenerated.

webknjaz commented 7 months ago

Thanks for the explanation!

felixfontein commented 7 months ago

Thanks!