fix(template_formatter): preserve dash separator around empty conditional

When an empty conditional sits between a dot and a dash (e.g. `.{atmos?}-{tag}`),
the left-side dot was kept and the dash before the tag was dropped, producing
`...DDP5.1.TAG` instead of `...DDP5.1-TAG`. Prefer the dash when it is the
right-side separator.

Closes #107
This commit is contained in:
imSp4rky
2026-05-12 08:24:31 -06:00
parent 20c15f761b
commit c0929bf217

View File

@@ -73,7 +73,9 @@ class TemplateFormatter:
has_left = s[0] in ".- " has_left = s[0] in ".- "
has_right = s[-1] in ".- " has_right = s[-1] in ".- "
if has_left and has_right: if has_left and has_right:
return s[0] # keep left separator if s[-1] == "-":
return s[-1]
return s[0]
return "" return ""
result = re.sub( result = re.sub(