jsoup icon indicating copy to clipboard operation
jsoup copied to clipboard

removeTags

Open jja opened this issue 14 years ago • 2 comments

Can you add a removeTags() method to Whitelist? For example, I might want Whitelist.basic but without the 'a' tag. Because tagNames is private and TagName is package-private, I can't add the method to a subclass. So I have to cut and paste code from Whitelist.

public Whitelist removeTags(String... tags) { { Validate.notNull(tags);

    for (String tagName : tags) {
        Validate.notEmpty(tagName);
        tagNames.remove(TagName.valueOf(tagName));
    }
    return this;
}

jja avatar Dec 05 '11 20:12 jja

My vote for this feature request, and i add removeAttributes also

tonig avatar Dec 12 '11 19:12 tonig

Sorry for late reply. This was added in 1.8.2 #449

jhy avatar Jul 06 '15 06:07 jhy