Wrap multi-expression sx returns in fragments to prevent kwarg truncation

When multiple sx expressions are concatenated and passed as a kwarg
value via SxExpr(), the parser only sees the first as the value — the
rest become extra args silently dropped by the component. Wrap in (<>)
fragments in render_editor_panel() and _page_cards_sx().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 14:56:05 +00:00
parent b7d95a8b4e
commit 48696498ef

View File

@@ -364,7 +364,7 @@ def _page_cards_sx(ctx: dict) -> str:
else:
parts.append(sx_call("blog-no-pages"))
return "".join(parts)
return "(<> " + " ".join(parts) + ")" if parts else ""
def _page_card_sx(page: dict, ctx: dict) -> str:
@@ -1267,7 +1267,7 @@ def render_editor_panel(save_error: str | None = None, is_page: bool = False) ->
)
parts.append(sx_call("blog-editor-scripts", js_src=editor_js, init_js=init_js))
return "".join(parts)
return "(<> " + " ".join(parts) + ")" if parts else ""
# ---- New post/page ----