Here you can find the source of cleanupHtmlDoc(String s)
public static String cleanupHtmlDoc(String s)
//package com.java2s; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class Main { public static String cleanupHtmlDoc(String s) { if (s != null) { Document doc = Jsoup.parse(s); doc.outputSettings().prettyPrint(true); s = doc.toString();//from w ww . ja va2 s. c o m } return s; } public static String prettyPrint(String html) { Document doc = Jsoup.parse(html); doc.outputSettings().prettyPrint(true); return doc.toString(); } }