Fix custom element check: require keyword arg to disambiguate from variables
Hyphenated names like app-url are variables, not custom elements. Only treat as custom element when first arg is a Keyword (tag call pattern). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -468,8 +468,8 @@ def _render_list(expr: list, env: dict[str, Any]) -> str:
|
||||
return _render_component(val, expr[1:], env)
|
||||
# Fall through to evaluation
|
||||
|
||||
# --- Custom element (hyphenated name) → render as tag ------------
|
||||
if "-" in name:
|
||||
# --- Custom element (hyphenated name with keyword attrs) → tag ----
|
||||
if "-" in name and len(expr) > 1 and isinstance(expr[1], Keyword):
|
||||
return _render_element(name, expr[1:], env)
|
||||
|
||||
# --- SVG/MathML context → unknown names are child elements --------
|
||||
|
||||
Reference in New Issue
Block a user