org.liquidsite.core.text
Class HtmlFormatter

java.lang.Object
  extended byorg.liquidsite.core.text.HtmlFormatter

public class HtmlFormatter
extends java.lang.Object

An HTML text formatter. This class contains static methods for processing HTML text.


Constructor Summary
HtmlFormatter()
           
 
Method Summary
static java.lang.String clean(java.lang.String text)
          Cleans an HTML text string.
static java.lang.String formatHtml(java.lang.String text, FormattingContext context)
          Formats an HTML text string in HTML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlFormatter

public HtmlFormatter()
Method Detail

clean

public static java.lang.String clean(java.lang.String text)
Cleans an HTML text string. Unneeded line feeds and space characters at the end will be removed.

Parameters:
text - the tagged text string
Returns:
the cleaned HTML text string

formatHtml

public static java.lang.String formatHtml(java.lang.String text,
                                          FormattingContext context)
Formats an HTML text string in HTML. This method will resolve any links in the HTML, but otherwise leave the HTML code unmodified.

Parameters:
text - the HTML text string
context - the formatting context
Returns:
the HTML encoded text