kotlinx.html
kotlinx.html copied to clipboard
Invalid attributes name for names starting with '[' and '('
I need to embed a third party angular element.
When trying this out using the kotlinx.html DSL I ran into a problem that these angular elements have attribute names which start with '[' or '(' for example:
<todo "[todo]" = "todo"></todo>
For events they seem to use (someEvent)
.
Currently I am seeing
Tag some-tag has invalid attribute name (onsomeevent)
According to https://www.w3.org/TR/html/syntax.html:
Attributes for an element are expressed inside the element’s start tag.
Attributes have a name and a value. Attribute names must consist of one or more characters other than the space characters, U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+003E GREATER-THAN SIGN (>), U+002F SOLIDUS (/), and U+003D EQUALS SIGN (=) characters, the control characters, and any characters that are not defined by Unicode. In the HTML syntax, attribute names, even those for foreign elements, may be written with any mix of lower- and uppercase letters that are an ASCII case-insensitive match for the attribute’s name.
This is still an issue. It really does prevent integration with front end frameworks.
Bump - if we want to use kotlinxhtml to build the html templates for almost every modern front end framework around we need to be able to have attributes that start with various chracters - for example [#, @, :]
As indicated by the original issue raiser - these are valid characters for html attributes, and frameworks use them.