RtfToMarkdown

Converts an RTF document to a Markdown approximation. Tracks the bold (Command.b) and italic (Command.i) toggles and wraps body text runs in ** and _. Body-text filtering matches RtfTextExtractor: only Command.rtf, Command.pntext and Command.fldrslt destinations contribute text.

Command.par yields a paragraph break (blank line), Command.line a hard break, and Command.tab a tab. Markdown-significant characters in body text are escaped.

Character formatting is group-scoped: a snapshot of the bold/italic state is pushed at each group start and restored at the matching group end, mirroring how RTF braces scope formatting (e.g. {\b bold} resets bold at the }). Explicit \b0/\i0 toggles still mutate the current state within a group.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The Markdown accumulated so far, with trailing whitespace trimmed.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun processCommand(command: Command, parameter: Int, hasParameter: Boolean, optional: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun processGroupEnd()
Link copied to clipboard
open override fun processGroupStart()
Link copied to clipboard
open override fun processString(string: String)