List of utility methods to do HTML Filter
String | filterHtml(String body) filter Html if (body == null) { return ""; body = body.replace(" ", " ").replace("\r", "<BR/>").replace("\n", "<BR/>").replaceAll("<", "<") .replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", """); return body; |
String | filterHtml(String input) * Remove HTML from input string. String out = input.replaceAll("<.*?>", ""); out = out.replaceAll(" +", " "); out = out.replaceAll(",(\\S)", ", $1"); return out; |
String | filterHTML(String input) filter HTML String result = (input == null ? "" : input); if (input != null && input.length() > 0) { StringBuffer filtered = new StringBuffer(input.length()); char c; for (int i = 0; i < input.length(); i++) { c = input.charAt(i); String s = null; switch (c) { ... |
String | filterHTML(String input) filter HTML StringBuffer filtered = new StringBuffer(input.length()); char c; for (int i = 0; i < input.length(); i++) { c = input.charAt(i); if (c == '<') { filtered.append("<"); } else if (c == '>') { filtered.append(">"); ... |
String | filterHTML(String s) Filters out all HTML tags. if (s == null) { return null; s = s.replaceAll("<", ""); s = s.replaceAll(">", ""); s = s.replaceAll(" ", ""); s = s.replaceAll("(?s)<[Ss][Cc][Rr][Ii][Pp][Tt].*?>.*?</[Ss][Cc][Rr][Ii][Pp][Tt]>", ""); s = s.replaceAll("(?s)<[Ss][Tt][Yy][Ll][Ee].*?>.*?</[Ss][Tt][Yy][Ll][Ee]>", ""); ... |
String | filterHtml(String s) filter Html if (s == null) { return null; s = s.replaceAll("<", ""); s = s.replaceAll(">", ""); s = s.replaceAll(" ", ""); s = s.replaceAll("(?s)<!--.*?-->", ""); return s.replaceAll("(?s)<.*?>", ""); ... |
String | filterHtmlAndTruncate(String s) filter Html And Truncate return filterHtmlAndTruncate(s, DEFAULT_MAX_CONTENT_LENGTH);
|
String | filterHtmlAndTruncate(String s) filter Html And Truncate return filterHtmlAndTruncate(s, MAX_CONTENT_LENGTH);
|
String | filterHtmlTag(String body) filter Html Tag if (body == null) { return ""; body = body.replaceAll("FRAME", ""); body = body.replaceAll("frame", ""); body = body.replaceAll("Frame", ""); body = body.replaceAll("APPLET", ""); body = body.replaceAll("applet", ""); ... |
String | filterHtmlTag(String content) filter Html Tag boolean flag = true; StringBuffer stringBuffer = new StringBuffer(2048); for (int i = 0; i < content.length(); i++) { if (content.charAt(i) == '<') { flag = false; continue; if (content.charAt(i) == '>') { ... |