Closed Ocean-OS closed 3 days ago
From WHATWG specs
name must match the PotentialCustomElementName
production:
PotentialCustomElementName
::= [a-z] (PCENChar)* '-' (PCENChar)*
PCENChar
::= "-" | "." | [0-9] | "_" | [a-z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
name must not be any of the following:
If I see a tag with a hyphen at the end, I think it is a typo; it is a really bad name. The name can include emojis and other things — not a good style, but not as bad as ending with a hyphen. And there is a list of forbidden names - Svelte doesn't seem to forbid them even in types, though you'll immediately get a runtime error.
Describe the bug
When using the
customElement
tag insvelte:options
, it only allows names that have a hyphen (that is not at the beginning or end). However, Custom Elements are allowed to have a name ending with a hyphen.Example
component
is an invalid name in both Custom Elements and Svelte.component-name
is a valid name in both Custom Elements and Svelte.component-
is a valid name in Custom Elements, but an invalid name in Svelte.Reproduction
REPL link
Logs
No response
System Info
Severity
annoyance