3 ms·
Unfortunately, I don't think this is valid HTML. Sad! https://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#:~:text=Tags%20contain%20a%20tag%20name,005A%20LA
by wilg 4y ago
Unfortunately, I don't think this is valid HTML. Sad! https://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#:~:text=Tags%20contain%20a%20tag%20name,005A%20LATIN%20CAPITAL%20LETTER%20Z https://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#:~:....
- phendrenad2 4y agoMust be ReactJS!
- deleted 4y ago[deleted]
- kzrdude 4y ago<marquee>Killjoy</marquee>
- deleted 4y ago[deleted]
- jwilk 4y ago<hat type="conspiracy">...</hat> would work better.
- _nalply 4y agoDid you know you can omit quotes? <hat type=conspiracy>...</hat> Source: HTML Standard Snapshot per today (November 5th 2022): https://html.spec.whatwg.org/commit-snapshots/53346e4641595aa470656dd1bcaa292e3dfcb4ef/#unquoted https://html.spec.whatwg.org/commit-snapshots/53346e4641595a... (using a snapshot here to avoid link rot)
- deleted 4y ago[deleted]
- CharlesW 4y agoThe only problem is the underscore, I think. A <conspiracy-hat> custom element would be valid HTML.
- jwilk 4y agoNo, only ASCII alphanumerics are allowed in HTML 5 tag names.
- CharlesW 4y agoIn fact, custom elements apparently must have a dash. From https://usefulangle.com/post/363/custom-element-valid-name https://usefulangle.com/post/363/custom-element-valid-name: • Name has to start with a lowercase ASCII character. It cannot have an uppercase ASCII character anywhere. UTF-8 characters, emojis, etc. are allowed as long as they are not the starting character • Name must contain a dash ("-") character. This dash character helps the browser to distinguish custom elements from regular elements.
- jwilk 4y agoIndeed. This is the relevant part of the specification: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name https://html.spec.whatwg.org/multipage/custom-elements.html#...
- runlevel1 4y agoAdd a hyphen somewhere in the middle and you're good to go: https://html.spec.whatwg.org/#valid-custom-element-name https://html.spec.whatwg.org/#valid-custom-element-name