Commit c7c38e9a by Michael DeHaan

Merge pull request #342 from jhoekx/fix-jinja-newline

Preserve trailing newline after templating.
parents 1dbea823 55fbc952
......@@ -241,7 +241,10 @@ def template(text, vars, setup_cache, no_engine=False):
return text
else:
template = jinja2.Template(text)
return template.render(vars)
res = template.render(vars)
if text.endswith('\n') and not res.endswith('\n'):
res = res + '\n'
return res
def double_template(text, vars, setup_cache):
return template(template(text, vars, setup_cache), vars, setup_cache)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment