I have a Mako template with some blocks in it like this:
<%page />
% for x in ["one", "two", "three"]:
<%
y = ''.join(reversed(x))
%>
${x} backwards is ${y}
% endfor
When I render this template I get something with a lot of extra blank lines:
one backwards is eno
two backwards is owt
three backwards is eerht
I want the output to look like this:
one backwards is eno
two backwards is owt
three backwards is eerht
Is there a way to do this, other than manually adding a \ after every block and tag?
There's a similar question about this here but it's 9 years old, and the accepted answer is to post-process the Mako output. This is not a great solution for my use case since I want to preserve blank lines in the output except those which came from a block/tag, and it's non-trivial to determine which those are.