Class RichTextImporter

java.lang.Object
com.codename1.ui.editor.RichTextImporter

public final class RichTextImporter extends Object
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 Details

    • parse

      public static HtmlImporter.Result parse(String content, RichTextFormat format)
      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

      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.