Fix sexp parse errors: avoid literal parentheses in sexp string args

The sexp parser doesn't handle "(" and ")" as string literals
inside expressions. Use raw! with pre-formatted strings instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 14:20:41 +00:00
parent 09b5a5b4f6
commit 0d1ce92e52
2 changed files with 10 additions and 8 deletions

View File

@@ -716,8 +716,9 @@ def _day_row_html(ctx: dict, entry) -> str:
'(td :class "p-2 align-top w-1/6" (div :class "text-xs font-medium"'
' (a :href h :class pc :hx-get h :hx-target "#main-panel" :hx-select "#main-panel"'
' :hx-swap "outerHTML" :hx-push-url "true" sn)'
' (span :class "text-stone-600 font-normal" (str "(" ts te ")"))))',
h=slot_href, pc=pill_cls, sn=slot.name, ts=time_start, te=time_end,
' (span :class "text-stone-600 font-normal" (raw! time-str))))',
h=slot_href, pc=pill_cls, sn=slot.name,
**{"time-str": f"({time_start}{time_end})"},
)
else:
start = entry.start_at.strftime("%H:%M") if entry.start_at else ""