public final class RichTextImporter

  1. Object
  2. 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.

Methods

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