MarkdownToRtf

Converts a small Markdown subset into a StyledDocument, then to RTF via RtfWriter.

Supported subset:

  • Paragraphs are separated by one or more blank lines.

  • Inline bold: **text** or __text__.

  • Inline italic: *text* or _text_.

  • Combined bold+italic: ***text*** (or the ___text___ underscore form).

Headings, lists and links are out of scope: #, -, [ and friends are treated as literal text. An unmatched emphasis marker is emitted as a literal character rather than opening a span.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun convert(markdown: String): StyledDocument

Parses markdown into a StyledDocument, one Paragraph per blank-line-separated block.