BrightSide Workbench Full Report + Source Code
org.turro.html.HTMLEntities Class Reference

Static Public Member Functions

static String escape (String html)
 
static String unescape (String html)
 
static String plainWhenPossible (String html)
 

Detailed Description

Author
Lluis Turró Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file HTMLEntities.java.

Member Function Documentation

◆ escape()

static String org.turro.html.HTMLEntities.escape ( String  html)
static

Definition at line 116 of file HTMLEntities.java.

116  {
117  if(html != null && "ISO-8859-1".equals(ElephantContext.getEncoding())) {
118  for(String entity : Entities_ISO88591) {
119  html = html.replaceAll("\\" + StringEscapeUtils.unescapeHtml4(entity), "\\" + entity);
120  }
121  }
122  return html;
123  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plainWhenPossible()

static String org.turro.html.HTMLEntities.plainWhenPossible ( String  html)
static

Definition at line 134 of file HTMLEntities.java.

134  {
135  if(html != null && "ISO-8859-1".equals(ElephantContext.getEncoding())) {
136  html = html.replaceAll("[\\‘\\’\\’ ]", "'")
137  .replaceAll("[\\“\\”\\“\\”]", "\"")
138  .replaceAll("[\\…]", "\\.\\.\\.")
139  .replaceAll("[\\•]", "\\·")
140  .replaceAll("[\\—]", "\\-");
141  }
142  return html;
143  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unescape()

static String org.turro.html.HTMLEntities.unescape ( String  html)
static

Definition at line 125 of file HTMLEntities.java.

125  {
126  if(html != null && "ISO-8859-1".equals(ElephantContext.getEncoding())) {
127  for(String entity : Entities_ISO88591) {
128  html = html.replaceAll("\\" + entity, "\\" + StringEscapeUtils.unescapeHtml4(entity));
129  }
130  }
131  return html;
132  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: