Skip to content

Commit

Permalink
collapse spacing of template; not of final result
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Apr 22, 2024
1 parent b64f4d0 commit 5571386
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rose/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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
)

Expand Down

0 comments on commit 5571386

Please sign in to comment.