public interface RichTextHandler
RichText| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
TAG_PATTERN |
static java.lang.String |
URL_TAG_PREFIX |
static java.lang.String |
URL_TAG_SEPARATOR |
static java.lang.String |
URL_TAG_SUFFIX |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
escapeTags(java.lang.String text)
Replaces all '<' by '< ', effectively invalidating all HTML tags
|
java.lang.String |
replaceTagsByUrls(java.lang.String html)
Replaces internal tags to URLs.
|
java.lang.String |
replaceTagsByUrls(java.lang.String html,
User user)
Same as
replaceTagsByUrls(String) but using the root url and network of the specified user, |
java.lang.String |
replaceUrlsByTags(java.lang.String html)
Replaces URLs to to internal tags.
|
java.lang.String |
replaceUrlsByTags(java.lang.String html,
User user)
Same as
replaceUrlsByTags(String) but using the root url and network of the specified user, |
java.lang.String |
sanitize(java.lang.String html)
Sanitizes the given HTML, removing blacklisted tags, correctly closing unclosed tags and removing leading /
trailing
whitespaces.
|
java.lang.String |
unescapeTags(java.lang.String text)
Replaces all '< ' by '<', reverting the result of
escapeTags(String) |
static final java.lang.String URL_TAG_PREFIX
static final java.lang.String URL_TAG_SEPARATOR
static final java.lang.String URL_TAG_SUFFIX
static final java.util.regex.Pattern TAG_PATTERN
java.lang.String escapeTags(java.lang.String text)
java.lang.String replaceTagsByUrls(java.lang.String html)
replaceUrlsByTags(String)java.lang.String replaceTagsByUrls(java.lang.String html,
User user)
replaceTagsByUrls(String) but using the root url and network of the specified user,java.lang.String replaceUrlsByTags(java.lang.String html)
sanitize(String) is sufficient, but there might be
cases where an HTML sanitization is not needed, just the replacing of URL tags by full URLs.
The following tags are handled:
ConfigurationImageType.UserImage.UserCustomImage.AdImage.SystemCustomImage.java.lang.String replaceUrlsByTags(java.lang.String html,
User user)
replaceUrlsByTags(String) but using the root url and network of the specified user,java.lang.String sanitize(java.lang.String html)
java.lang.String unescapeTags(java.lang.String text)
escapeTags(String)