Skip to content

Instantly share code, notes, and snippets.

@talfco
Created Apr 5, 2015
Embed
What would you like to do?
protected String cleanupHTML(String elem) {
Whitelist list = Whitelist.basicWithImages();
list.addTags("div");
list.addEnforcedAttribute("a", "rel", "nofollow");
list.addAttributes(":all","style");
String doc = Jsoup.clean(elem, list);
logger.debug("Jsoup.clean: "+doc);
Document xmlDoc = Jsoup.parse(doc);
return cleanupStyle(xmlDoc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment