List of usage examples for org.apache.commons.lang3 StringEscapeUtils unescapeHtml3
public static final String unescapeHtml3(final String input)
Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
From source file:org.sakaiproject.qna.logic.impl.NotificationLogicImpl.java
/** * Strip tags from html Copy of TextUtil method in tool *///from w w w. j a v a 2 s.c o m private String stripTags(String html) { return StringEscapeUtils.unescapeHtml3(html.replaceAll("\\<.*?>", "").replaceAll(" ", " ")); }
From source file:org.sakaiproject.qna.utils.TextUtil.java
/** * Strips all HTML tags from string/*from ww w. ja va 2 s .co m*/ * * @param String with html tags * @return String without tags */ public static String stripTags(String html) { String cleanup = QNAUtils.cleanupHtmlPtags(html); return StringEscapeUtils.unescapeHtml3(cleanup.replaceAll("\\<.*?>", "").replaceAll(" ", " ")); //return cleanup.replaceAll("\\<.*?>","").replaceAll("<", "<").replaceAll(">", ">").replaceAll(" ", " ").replaceAll("&", "&"); }