Java Code Examples for org.jsoup.safety.Whitelist#none()

The following examples show how to use org.jsoup.safety.Whitelist#none() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextFilterManage.java    From bbs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 文本过滤标签,只保留<br>标签
 * @param html
 * @return
 */
public String filterTag_br(String html) {  
	if(StringUtils.isBlank(html)) return ""; 
	
	Whitelist whitelist = Whitelist.none();//只保留文本,其他所有的html内容均被删除
	whitelist.addTags("br");
	
    return Jsoup.clean(html, whitelist); 
	//return Jsoup.clean(html,"", whitelist,new OutputSettings().prettyPrint(false)); //prettyPrint(是否重新格式化)
}
 
Example 2
Source File: Header.java    From viritin with Apache License 2.0 4 votes vote down vote up
protected Whitelist getWhitelist() {
    return Whitelist.none();
}
 
Example 3
Source File: Header.java    From viritin with Apache License 2.0 4 votes vote down vote up
protected Whitelist getWhitelist() {
    return Whitelist.none();
}