Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class RichTextImporter
- Object
- RichTextImporter
Parses supported rich-text interchange formats into the shared editor model. HTML delegates to the
framework HTML/XML parser; Markdown and RTF are read by
com.codename1.wordprocessing, the one
implementation of each in the framework; AsciiDoc is parsed here.Methods
public static HtmlImporter.Result parse(String content, RichTextFormat format) | Parses rich text into the editor model. |
public static String fromHtml(String html, RichTextFormat format) | Converts HTML produced by a browser fallback into another rich-text format through the shared document model. |
public static String convert(String content, RichTextFormat sourceFormat, RichTextFormat targetFormat) | Converts between non-HTML formats through the native rich-text model. |
public static String toHtml(String content, RichTextFormat format) | Converts content to an HTML fragment. |
Inherited methods
Method details
parse
public static HtmlImporter.Result parse(String content, RichTextFormat format)Parses rich text into the editor model. AsciiDoc is built directly; Markdown and RTF come
through the word processing readers.
fromHtml
public static String fromHtml(String html, RichTextFormat format)Converts HTML produced by a browser fallback into another rich-text format through the shared
document model. Pure editors do not use this path for Markdown or AsciiDoc input.
convert
public static String convert(String content, RichTextFormat sourceFormat, RichTextFormat targetFormat)Converts between non-HTML formats through the native rich-text model. This preserves source
mode in browser fallbacks without using HTML as an intermediate representation.
toHtml
public static String toHtml(String content, RichTextFormat format)Converts content to an HTML fragment. HTML input is returned unchanged and plain text is escaped.