diff --git a/calculate/templates/template_engine.py b/calculate/templates/template_engine.py index b3b2e17..9d906fd 100644 --- a/calculate/templates/template_engine.py +++ b/calculate/templates/template_engine.py @@ -1558,9 +1558,12 @@ class TemplateEngine: if directory_path is not None: self.environment = Environment( - loader=FileSystemLoader(directory_path)) + loader=FileSystemLoader(directory_path), + trim_blocks=True, + lstrip_blocks=True) else: - self.environment = Environment() + self.environment = Environment(trim_blocks=True, + lstrip_blocks=True) self.environment.filters = CALCULATE_FILTERS diff --git a/tests/templates/test_directory_processor.py b/tests/templates/test_directory_processor.py index 8f21116..cf692de 100644 --- a/tests/templates/test_directory_processor.py +++ b/tests/templates/test_directory_processor.py @@ -1446,7 +1446,7 @@ class TestDirectoryProcessor: '# Processed template files:\n' + f'# {template_path}\n' + '#' + '-' * 79 + - f'\n\n\ntemplate = {template_path}') + f'\n\ntemplate = {template_path}') directory_processor = DirectoryProcessor( 'install', datavars_module=datavars,