Rich text / API

foldkit-richtext-markdown

foldkit-richtext-markdown — the Markdown interpreter (§124 §1). Markdown is an interpreter over a semantic Document, not a second document model: this maps both directions and reports what a mapping cannot express rather than dropping it silently.

print writes CommonMark with GFM's lists, tasks, strikethrough, and tables; parse reads the same set back, so print(parse(markdown)) and parse(print(document)) are the round trips the design's testing section asks for. A profile for custom syntax arrives when a custom syntax needs both directions at once.

Functions

closeSourceEnds a session against the document the caller holds. A pure read, so it also serves as a preview of the draft: nothing is committed until the caller puts…
openSourceOpens a session on a document: its Markdown, as both what was printed and the draft, spelled as style says, so a writer's _hello_ comes back as they wrote…
parseReads Markdown into a document. mint supplies every identity, so a parse never collides with what the caller already has; the document is decoded through…
printPrints a document as CommonMark with GFM's lists, tasks, strikethrough, and tables. Anything the mapping has no syntax for is reported in diagnostics; an…

Values

BlockSpellingHow one block was spelled: a list's marker and spacing, a heading's form, a fence, a rule (§146).
MarkdownDiagnostic
markdownInlineRulesThe inline markers: **bold**, *italic* and _italic_, `code`, and ~~struck~~. Content never holds its delimiter's character, so **a** is never read as italic…
markdownInputRulesThe block markers the standard vocabulary can carry out, then the inline ones.
MarkdownStyle
SourceSession

Interfaces