From 5571386af0c8b4e51ca294893dd240dcb9732e08 Mon Sep 17 00:00:00 2001 From: blissful Date: Mon, 22 Apr 2024 16:33:53 -0400 Subject: [PATCH] collapse spacing of template; not of final result --- rose/templates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rose/templates.py b/rose/templates.py index 2b68140..bdc359e 100644 --- a/rose/templates.py +++ b/rose/templates.py @@ -121,7 +121,7 @@ class PathTemplate: @cached_property def compiled(self) -> jinja2.Template: - return ENVIRONMENT.from_string(self.text) + return ENVIRONMENT.from_string(_collapse_spacing(self.text)) def __hash__(self) -> int: return hash(self.text) @@ -256,7 +256,7 @@ def eval_release_template( release: CachedRelease, position: str | None = None, ) -> str: - return _collapse_spacing(template.compiled.render(**_calc_release_variables(release, position))) + return template.compiled.render(**_calc_release_variables(release, position)) def eval_track_template( @@ -265,7 +265,7 @@ def eval_track_template( position: str | None = None, ) -> str: return ( - _collapse_spacing(template.compiled.render(**_calc_track_variables(track, position))) + template.compiled.render(**_calc_track_variables(track, position)) + track.source_path.suffix )