Java HTML Parse Jsoup cleanupHtmlDoc(String s)

Here you can find the source of cleanupHtmlDoc(String s)

Description

cleanup Html Doc

License

Open Source License

Declaration

public static String cleanupHtmlDoc(String s) 

Method Source Code

//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();
    }
}

Related

  1. clean(String html, Whitelist whitelist)
  2. cleanHTML(final String html)
  3. cleanHtmlCode(String html)
  4. cleanHtmlFromString(String stringToClean)
  5. cleanHTMLTags(String str)
  6. clearBody(String html)
  7. coverTag(String html, String... tagNames)
  8. extractRssUrl(String html, URI base)
  9. filter(String html)