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

Convert attr-name to attrName when referencing in data. #71

Closed
zachleat opened this issue Nov 16, 2022 · 3 comments
Closed

Convert attr-name to attrName when referencing in data. #71

zachleat opened this issue Nov 16, 2022 · 3 comments

Comments

@zachleat
Copy link
Member

parse5 enforces the HTML specification and converts both attributes and @-prefixed properties to lowercase

<my-component attrName="test" @propName="test">

(is referenced inside my-component as attrname and propname respectively).

First reported by @voxpelli: #62 (comment)

I don’t know if we necessarily want to add to the parsing complexity but a nice workaround could be to convert dash names to camelcase:

e.g. @prop-name would be referenced as propName and attr-name would be referenced as attrName

Open for discussion here!

@zachleat
Copy link
Member Author

Future note for me: the code for this is merged but disabled until 0.8.0

zachleat added a commit to 11ty/11ty-website that referenced this issue Dec 2, 2022
@zachleat
Copy link
Member Author

zachleat commented Dec 2, 2022

Shipping with v0.8.0

@anghelos
Copy link

anghelos commented Jul 5, 2023

Is there any way to escape that for HTML data-* attributes? Say I want an attribute to be data-image and remain as such. Also see #178 and #163

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

No branches or pull requests

2 participants