-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
data-* attribute selection doesn't work #7
Comments
hello there, it's me again :P just tried to find an element based on a data-* attribute and it's not being found. I'm starting to think you have some issue with dashes 😄 |
Hi again! yes, in hast, the properties are camelcased. A lot of our previous conversation applies here. About jsx. About what hastscript does. |
ah dang it, I mixed up the camelcasing. You see, I had that thought as well but didn't change the property to camelcase in the test setup but the selector 🤦♀️. I'm getting the dashed properties for the same reason as in the other issue - because I'm explicitly assigning them as a workaround for the "2nd argument type value" problem. Anyway, in that case I think this issue can be closed because it either doesn't apply to this repo or because I can fix it on my end. Sorry for the interruption. |
This comment has been minimized.
This comment has been minimized.
This was already solved! You can run
👍 |
I'm not sure I follow. Using Using |
@mordechaim you can see here that it does work as expected - the question is: what does your tree look like? |
Ah for me the tree is like:
|
@mordechaim properties are camel cased. const tree = {
type: "element",
properties: {
name: "foo",
"dataName": "foo"
}
} You can use a hast parser on a real document to see what properties should look like, for example: https://stackblitz.com/edit/github-b1fwzc?file=src%2Findex.ts |
Initial checklist
Affected packages and versions
hast-util-select@6
Link to runnable example
https://jsbin.com/lihidasupa/1/edit?html,console
Steps to reproduce
Expected behavior
Element should be found
Actual behavior
Element isn't found
Affected runtime and version
chromium@Version 121.0.6167.85 (Official Build) Arch Linux (64-bit)
Affected package manager and version
No response
Affected OS and version
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: