Rich text / foldkit-richtext-markdown

foldkit-richtext-markdown

Read and write Markdown for a foldkit-richtext document.

Markdown is an interpreter over the semantic document, not a second document model. This package maps a document to CommonMark — with GFM's lists, tasks, strikethrough, and tables — reads the same set back, and reports what a mapping cannot express instead of dropping it silently.

Printing needs nothing beyond this package. Parsing uses micromark and mdast, the parser stack the design asks for. Both directions return diagnostics, so a caller can refuse, warn, or show a placeholder rather than lose content.

Install

bash
pnpm add foldkit-richtext-markdown

What it owns

The Markdown syntax, and nothing else. The document stays foldkit-richtext's, the editable subtree stays foldkit-richtext-dom's, and no state lives here: print is a pure function of a Document, and a source session is a value the application keeps.