19 package org.turro.html;
21 import org.apache.commons.text.StringEscapeUtils;
22 import org.turro.elephant.context.ElephantContext;
30 private static final String Entities_ISO88591[] = {
91 private static final String SINGLE_QUOTE[] = {
97 private static final String DOUBLE_QUOTE[] = {
103 private static final String HELLIP[] = {
107 private static final String BULLET[] = {
111 private static final String DASH[] = {
116 public static String
escape(String html) {
118 for(String entity : Entities_ISO88591) {
119 html = html.replaceAll(
"\\" + StringEscapeUtils.unescapeHtml4(entity),
"\\" + entity);
127 for(String entity : Entities_ISO88591) {
128 html = html.replaceAll(
"\\" + entity,
"\\" + StringEscapeUtils.unescapeHtml4(entity));
136 html = html.replaceAll(
"[\\‘\\’\\ ]",
"'")
137 .replaceAll(
"[\\“\\”\\\\]",
"\"")
138 .replaceAll(
"[\\…]",
"\\.\\.\\.")
139 .replaceAll(
"[\\•]",
"\\·")
140 .replaceAll(
"[\\—]",
"\\-");
static String getEncoding()
static String escape(String html)
static String plainWhenPossible(String html)
static String unescape(String html)