public class HTMLFormatter
extends java.lang.Object
Rewritten to fix TW-8635.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
URL_PATTERN |
Constructor and Description |
---|
HTMLFormatter() |
Modifier and Type | Method and Description |
---|---|
static void |
addTransformLinkPattern() |
static java.lang.String |
format(java.lang.String text,
javax.servlet.jsp.JspContext context)
Searches for plain links in specified text and returns the same text with links
transformed to HTML links (<a href=""></a>).
|
static java.lang.String |
format(java.lang.String text,
WebContext context)
Searches for plain links in specified text and returns the same text with links
transformed to HTML links (<a href=""></a>).
|
static java.lang.String |
formatMultiLine(java.lang.String text)
Escapes the text for HTML and transforms line feeds with
<br> s. |
static java.lang.String |
formatMultiLine(java.lang.String text,
boolean escape)
Transforms line feeds with
<br> s. |
public static final java.lang.String URL_PATTERN
public static java.lang.String format(java.lang.String text, @NotNull javax.servlet.jsp.JspContext context)
text
- text containing linkscontext
- JSP contextpublic static java.lang.String format(java.lang.String text, @NotNull WebContext context)
text
- text containing linkscontext
- context for the transformation@NotNull public static java.lang.String formatMultiLine(@Nullable java.lang.String text)
<br>
s.text
- text to format@NotNull public static java.lang.String formatMultiLine(@Nullable java.lang.String text, boolean escape)
<br>
s.text
- text to formatescape
- true if text should be escaped firstpublic static void addTransformLinkPattern()