com.google.gdata.util.common.html
Class HtmlToText

java.lang.Object
  extended by com.google.gdata.util.common.html.HtmlToText

public final class HtmlToText
extends java.lang.Object

Convert provided html formatted string to text format.


Field Summary
static int EMAIL_LINE_WIDTH_MAX
          Maximum length of a line in email body (in characters)
 
Method Summary
static java.lang.String htmlToPlainText(java.lang.String html)
          Convert provided html string to plain text preserving the formatting as much as possible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMAIL_LINE_WIDTH_MAX

public static final int EMAIL_LINE_WIDTH_MAX
Maximum length of a line in email body (in characters)

See Also:
Constant Field Values
Method Detail

htmlToPlainText

public static java.lang.String htmlToPlainText(java.lang.String html)
Convert provided html string to plain text preserving the formatting as much as possible. Ensure line wrapping to 72 chars as default. NOTE: add support for more HTML tags here. For the present, convert <br> to '\n' convert <p> and </p> to '\n' convert <li> to "\n- "

Throws:
java.lang.NullPointerException