Created
April 5, 2015 23:41
-
-
Save talfco/2df5852bb69b0860b16f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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