-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
find() selector that starts with double hyphen gives "Failed to parse selector" error #1339
Comments
That seems like it’s because you can’t have a class name that starts with a hyphen - iow, it’s actually an invalid selector. |
Okay, you're right, my bad :) |
I’m not sure about that validator, but the spec says it’s not valid: http:https://www.w3.org/TR/CSS21/syndata.html#characters |
(That link is for v2.1 but i don’t think it changed in css3) |
As for escaped characters, we're aware its an issue and we do want to support it. See #1218. |
my apologies for the wrong link, I did not test to see if it works. |
This will be resolved by aweary/rst-selector-parser#11 |
The reality is that '--' prefix for class names is quite often used for BEM styled naming of modifiers (no namespace notation). |
Alright, I ran into this today but according to this issue and PRs it's fixed. I'm using [email protected] which should be using [email protected]. I'm getting this error when I try the following variations:
Neither seem to work, I get the |
@kamranayub you may need to |
Using enzyme 3.6.0 I'm getting the const divsWithInitialised = heroSlider(props).find('div.hero-slide.\\--initialised'); |
What version of rst-selector-parser do you have? If it’s the latest, then please file a new issue. |
Guys would the square brackets in a className be valid? Example: |
What does document.querySelector do with those? |
I've tried to find an element with class
--left
in it withelement.find('a.--left')
.This however gives the error
Error: Failed to parse selector: a.--left
When I remove the double hyphen in the component and the selector it does work.
The text was updated successfully, but these errors were encountered: