-
Notifications
You must be signed in to change notification settings - Fork 2.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
Multiple selectors for direct descendants catches indirect descendants as well #1707
Comments
I along with my group will be fixing this issue in this semester. |
Hi, I may just find the problem. |
Thanks, fixed!
In jsoup, if the query starts with a combinator, we combine it against the root element. The root element is the Document or the context element. |
Refactored so that it eats until a combinator is seen after non-combinator content, and returns it all. And corrected unit tests that were incorrectly relying on that behavior. Note that a leading combinator will combine against the root element, which is either the Document, or the context element. Fixes jhy#1707
Using
org.jsoup:jsoup:1.14.3
, it seems like using something like.select("> .direct > .foo, > .direct > .bar")
will also select.direct > .bar
.As a work-around:
.selectFirst("> .direct")!!.select("> .foo, > .bar")
seems to work fine.Not sure if it's a bug or a feature: in comparison, JS's
.querySelectorAll(> .direct)
throws about an invalid selector.The text was updated successfully, but these errors were encountered: