Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid attributes name for names starting with '[' and '(' #118

Closed
dvekeman opened this issue Apr 18, 2019 · 2 comments · Fixed by #276
Closed

Invalid attributes name for names starting with '[' and '(' #118

dvekeman opened this issue Apr 18, 2019 · 2 comments · Fixed by #276

Comments

@dvekeman
Copy link

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.

@lgwillmore
Copy link

This is still an issue. It really does prevent integration with front end frameworks.

@lgwillmore
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants