Class RichTextImporter
java.lang.Object
com.codename1.ui.editor.RichTextImporter
Parses supported rich-text interchange formats into the shared editor model. HTML delegates to the
framework HTML/XML parser; Markdown and AsciiDoc are parsed directly so neither format is rewritten
through HTML on input or output.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringconvert(String content, RichTextFormat sourceFormat, RichTextFormat targetFormat) Converts between non-HTML formats through the native rich-text model.static StringfromHtml(String html, RichTextFormat format) Converts HTML produced by a browser fallback into another rich-text format through the shared document model.static HtmlImporter.Resultparse(String content, RichTextFormat format) Parses rich text directly into the editor model.static StringtoHtml(String content, RichTextFormat format) Converts content to an HTML fragment.
-
Method Details
-
parse
Parses rich text directly into the editor model. Markdown and AsciiDoc use native model builders so their structure does not make an intermediate trip through HTML. -
fromHtml
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
Converts content to an HTML fragment. HTML input is returned unchanged and plain text is escaped.
-