Here you can find the source of cleanHTML(final String html)
Parameter | Description |
---|---|
html | HTML to be cleaned. |
public static String cleanHTML(final String html)
//package com.java2s; //License from project: Open Source License import org.jsoup.Jsoup; import org.jsoup.safety.Whitelist; public class Main { /**// w ww .j a va 2 s .c om * Remove most unsafe tags and attributes, leaving mostly format tags and links. * * @param html HTML to be cleaned. * @return Clean HTML. * * @see Jsoup#clean(String, Whitelist) * @see Whitelist#basic() */ public static String cleanHTML(final String html) { return html != null ? Jsoup.clean(html, Whitelist.basic()) : null; } }