-
-
Notifications
You must be signed in to change notification settings - Fork 901
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
DocumentFragment#search and #at don't handle CSS selectors properly #1205
Comments
Thanks for reporting this. Super interesting! I believe this has to do with how we're handling document fragments, and ignoring root nodes. I'll investigate. |
We're missing an specialization of |
I'd also like to note here that |
Will be in the next release of Nokogiri, hopefully sometime in the next week or so. |
Awesome! Thanks! Good to know about that performance trick as well! |
Hi there!
I just discovered an odd bit of behaviour for
HTML::DocumentFragment
s. If I try to select elements in the fragment using the#at
or#search
methods with CSS selectors, no elements are matched. If I use the#css
method, however, I do get elements back.Here's a script to demonstrate the problem:
Note that maching on the tag name does work, for some reason, but classes or IDs don't.
I was expecting the fragments to behave the same as regular Nokogiri documents. Is this a known problem?
Thanks for your time!
The text was updated successfully, but these errors were encountered: