Rich text / foldkit-richtext-markdown
Limits
- Minor round-trip losses: Trailing blank lines in code blocks, leading heading spaces, info-string words after a fence language (
```ts title), line breaks inside setext headings, and row cell count padding are adjusted without emitting diagnostics. - Table headers: GFM requires the first row to be the header, so
printalways writes the first row as the header and reports header flags on later rows. Cell blocks join on one line separated by spaces. - Block-only images:
Imageis a block node, so it prints on its own line;parsehoists a paragraph containing only an image into anImageblock. - Links without
href: Print as plain label text with anUnsupportedMarkdiagnostic. - URL handling:
printescapes punctuation backslashes,&references, angle-brackets spaces, and percent-encodes control characters;parsestrips controls, trims whitespace, drops link titles, and rejects unsafe schemes (UnsafeUrl). - Marks on edge whitespace: Because
**bold **is invalid in CommonMark, leading and trailing spaces move outside the delimiters and parse back unmarked. - Bare URLs: GFM autolinks bare
https://,www., and email text on parse. - Hard breaks, raw HTML, and link definitions: Hard line breaks split into new paragraphs with a diagnostic; raw HTML and link definitions are skipped and reported. Footnotes skip unless
footnotes: trueis passed, and labels with spaces print as plain text with a diagnostic. - Custom syntax: User-defined block or mark Markdown syntax requires a shared profile across both directions and is left for a future release.
Next
- Mount a browser editor with
markdownInputRules:foldkit-richtext-dom - Add a source-mode editor and live preview UI:
foldkit-mixins-richtext - Understand document nodes, marks, and Kits:
foldkit-richtext