Here you can find the source of tidyHtml(String html)
public static String tidyHtml(String html)
//package com.java2s; //License from project: Apache License import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Entities; public class Main { public static String tidyHtml(String html) { Document doc = Jsoup.parse(html); // Clean the document. //doc = new Cleaner(Whitelist.basicWithImages()).clean(doc); doc.outputSettings().escapeMode(Entities.EscapeMode.xhtml); doc.outputSettings().prettyPrint(true); doc.outputSettings().syntax(Document.OutputSettings.Syntax.xml); // Get back the string of the body. return doc.html(); }/* ww w . j ava 2s . c o m*/ }