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

Added new method childrenCount complementary to child(int) #1291

Merged
merged 1 commit into from
Feb 2, 2020

Conversation

literakl
Copy link
Contributor

@literakl literakl commented Jan 1, 2020

There is no easy way in the Element to find out a number of children available via the method child(int). The method childNodeSize() acts on list of all children while child(int) acts on the filtered list of the children. This trivial patch adds new method childrenCount() that is complementary to child(int) as it works on the same filtered list. A unit test is provided.

My observation: https://stackoverflow.com/questions/59547574/jsoup-how-to-find-out-elements-size

Thank you for this wonderful library and for consideration of merging this proposal.

@literakl
Copy link
Contributor Author

literakl commented Jan 3, 2020

It seems there is some configuration issue on github that the build fails:

The command "bash .install-jdk-travis.sh" failed and exited with 2 during .

@jhy jhy added this to the 1.12.2 milestone Feb 2, 2020
@jhy jhy added the improvement label Feb 2, 2020
@jhy jhy merged commit 468c536 into jhy:master Feb 2, 2020
@jhy
Copy link
Owner

jhy commented Feb 2, 2020

Thanks! Merged with 894d3ec

I renamed it to be childrenSize for consistency with the other sizes of lists.

This was referenced Feb 9, 2020
This was referenced Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants