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

Allow Nodes to be removed in NodeTraversor #1699

Closed
jhy opened this issue Dec 29, 2021 · 0 comments
Closed

Allow Nodes to be removed in NodeTraversor #1699

jhy opened this issue Dec 29, 2021 · 0 comments
Milestone

Comments

@jhy
Copy link
Owner

jhy commented Dec 29, 2021

This change allows nodes to be removed during the head() method of NodeVisitor. E.g.

        Document doc = Jsoup.parse("<div><p id=1>Zero<p id=1>One<p id=2>Two<p>Three</div>");
        NodeTraversor.traverse((node, depth) -> {
            if (node.attr("id").equals("1"))
                node.remove();
        }, doc);

Implemented with 2bad736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant