-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
querySelector and attribute's value #37
Comments
Thanks for reporting this. I'll look into it shortly. |
Hi @dmitriy-krista, it looks like the problem is with the use of the comma character, which isn't taking into account the quotes surrounding it. I've tested a simple attribute selector which works fine, so it looks like the way the attribute selector is parsed in PHP.Gt/CssXPath is to blame. I'll transfer this issue there and find a fix soon. |
I have isolated the bug to the naive use of Line 32 in 57e9a9e
|
Here is a test case I'm working on before implementing: https://regex101.com/r/xB7rQ7/224 Notice the last example doesn't work. If anyone could help me understand backreferences in this example, we can squish the bug and close this issue. |
Works a treat now. I'll release this to the next version which will be adopted by the next version of Dom. Have fun! |
When specifying the value for an attribute in querySelector() method like tag[attr='value'] , the method doesn't work as expected and returns null.
Example to reproduce the issue:
The expected behaviour is that the last line should print "Enterprise"
If I try to run the exact querySelector call in my browser, it works correctly and both lines print "Enterprise":
document.querySelector("nav > ul > li > a[data-ga-click]").innerText
document.querySelector("nav > ul > li > a[data-ga-click='(Logged out) Header, go to Enterprise']").innerText
The text was updated successfully, but these errors were encountered: