Skip to content
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

Add :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 #1175

Closed
wants to merge 2 commits into from

Conversation

haruntuncay
Copy link

@haruntuncay haruntuncay commented Jan 27, 2019

Added a feature to make :has(el) pseudo selector be able to search only in direct children, as requested in issue #1116.

For example:
doc.select("div:has(p)") //returns divs that are containing p elements anywhere in their sub-hierarchy.
New Feature:
doc.select("div:hasChild(p)") //returns divs that are containing p elements only in their direct children.

I have added the necessary comment for this new pseudo-selector in Selector.java so the documentation can be updated and added the necessary test case.

@haruntuncay haruntuncay changed the title add :hasDirect(el) pseudo-selector support for searching with :has(el) in direct children only, see #1116 add :hasDirect(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Jan 27, 2019
@haruntuncay haruntuncay changed the title add :hasDirect(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 add :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Jan 27, 2019
@haruntuncay haruntuncay changed the title add :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Added :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Jan 27, 2019
@haruntuncay haruntuncay changed the title Added :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Add :hasChild(el) pseudo-selector to support :has(el) selections that search in direct children only, see #1116 Jan 27, 2019
@haruntuncay
Copy link
Author

Hello @jhy ,
Hope you are doing well.
Could you please check out this PR when you have the time.
Thank you in advance.

@jhy
Copy link
Owner

jhy commented May 17, 2019

Thanks @haruntuncay, this looks good. We went with #1214 to simplify the selector query syntax.

@jhy jhy closed this May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants