jetbrains.buildServer.web.util
Class HTMLFormatter
java.lang.Object
jetbrains.buildServer.web.util.HTMLFormatter
public class HTMLFormatter
- extends java.lang.Object
Utility class which is used to substitute text containing various links
(http://, mailto:, ftp: and so on) with actual HTML link and line feeds with <br/> tag.
Rewritten to fix TW-8635.
|
Method Summary |
static java.lang.String |
format(java.lang.String text,
javax.servlet.http.HttpServletRequest request)
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTMLFormatter
public HTMLFormatter()
format
public static java.lang.String format(java.lang.String text,
@NotNull
javax.servlet.http.HttpServletRequest request)
- Searches for plain links in specified text and returns the same text with links
transformed to HTML links (<a href=""></a>).
- Parameters:
text - text containing linksrequest - HTTP request, for which formatting is performed
- Returns:
- text with transformed links
formatMultiLine
public static java.lang.String formatMultiLine(java.lang.String text)
- Escapes the text for HTML and transforms line feeds with
<br>s.
Note: in contrast with format(String, HttpServletRequest) this method
does not depend on build server settings.
- Parameters:
text - text to format
- Returns:
- a formatted text
- Since:
- 7.0