Fix custom element check: require keyword arg to disambiguate from variables
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m14s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m14s
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:
@@ -1194,7 +1194,7 @@
|
||||
var h = v[0];
|
||||
if (!isSym(h)) return false;
|
||||
var n = h.name;
|
||||
return !!(HTML_TAGS[n] || SVG_TAGS[n] || n === "<>" || n === "raw!" || n.charAt(0) === "~" || n.indexOf("html:") === 0 || n.indexOf("-") > 0);
|
||||
return !!(HTML_TAGS[n] || SVG_TAGS[n] || n === "<>" || n === "raw!" || n.charAt(0) === "~" || n.indexOf("html:") === 0 || (n.indexOf("-") > 0 && v.length > 1 && isKw(v[1])));
|
||||
}
|
||||
|
||||
function renderComponentDOM(comp, args, env) {
|
||||
@@ -1317,8 +1317,8 @@
|
||||
return warn;
|
||||
}
|
||||
|
||||
// Custom element (hyphenated name) → render as element
|
||||
if (name.indexOf("-") > 0) return renderElement(name, expr.slice(1), env, ns);
|
||||
// Custom element (hyphenated name with keyword attrs) → render as element
|
||||
if (name.indexOf("-") > 0 && expr.length > 1 && isKw(expr[1])) return renderElement(name, expr.slice(1), env, ns);
|
||||
|
||||
// SVG/MathML namespace auto-detection: inside (svg ...) or (math ...),
|
||||
// unknown tags are created with the inherited namespace
|
||||
|
||||
Reference in New Issue
Block a user