com.atlassian.confluence.util
Class PlainTextToHtmlConverter
java.lang.Object
com.atlassian.confluence.util.PlainTextToHtmlConverter
public class PlainTextToHtmlConverter
- extends java.lang.Object
Static methods for the conversion of text to HTML.
Method Summary |
static java.lang.String |
encodeHtmlEntities(java.lang.String text)
Encodes the angle brackets, ampersands, and quotation marks in the input as HTML entities. |
static java.lang.String |
matchAndReplaceSpaces(java.lang.String html)
|
static java.lang.String |
toHtml(java.lang.String plainText)
The function converts plain text into html in two steps. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlainTextToHtmlConverter
public PlainTextToHtmlConverter()
toHtml
public static java.lang.String toHtml(java.lang.String plainText)
- The function converts plain text into html in two steps.
1. utilize the oscore plain2html function to turn the plain text into html
including converting linebreaks and special characters.
2. finds occurences of multiple spaces and replaces them with   html entities.
- Returns:
- String converted to html
encodeHtmlEntities
public static java.lang.String encodeHtmlEntities(java.lang.String text)
- Encodes the angle brackets, ampersands, and quotation marks in the input as HTML entities.
- Parameters:
text
- string to encode
- Returns:
- the input with encoded HTML entities
matchAndReplaceSpaces
public static java.lang.String matchAndReplaceSpaces(java.lang.String html)
Copyright © 2003-2010 Atlassian. All Rights Reserved.