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 selectFirst and expectFirst to Elements #2263

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

midgleyc
Copy link
Contributor

Closes #2256.

I copied the docstrings, and behaviour, from the equivalent methods on Element and the surrounding methods on Elements.

src/main/java/org/jsoup/select/Selector.java Dismissed Show dismissed Hide dismissed
@jhy jhy added this to the 1.19.1 milestone Jan 24, 2025
@jhy jhy merged commit 8086b1e into jhy:master Jan 24, 2025
12 checks passed
@jhy
Copy link
Owner

jhy commented Jan 24, 2025

Cool, merged, thanks! I tweaked the formatting just to align with current style (which does diverge a bit from the existing code), and added a test to validate the root works the same as when selecting from an element.

@midgleyc midgleyc deleted the elements-select-first branch January 24, 2025 09:46
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.

FR: selectFirst() and expectFirst() on org.jsoup.select.Elements
2 participants