Fix Jinja stripping newlines at EOF

master
LEdoian 3 years ago
parent 1247948259
commit f05472259f

@ -31,7 +31,7 @@ class Computer:
context = {'c': self} context = {'c': self}
loader = jinja2.FileSystemLoader('templates/') loader = jinja2.FileSystemLoader('templates/')
environment = jinja2.Environment(loader=loader, trim_blocks=True) environment = jinja2.Environment(loader=loader, trim_blocks=True, keep_trailing_newline=True)
for f in files: for f in files:
template = environment.get_template(f) template = environment.get_template(f)
(Path('output') / self.name).mkdir(parents=True,exist_ok=True) (Path('output') / self.name).mkdir(parents=True,exist_ok=True)

Loading…
Cancel
Save