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 print always 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: Image is a block node, so it prints on its own line; parse hoists a paragraph containing only an image into an Image block.
  • Links without href: Print as plain label text with an UnsupportedMark diagnostic.
  • URL handling: print escapes punctuation backslashes, & references, angle-brackets spaces, and percent-encodes control characters; parse strips 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: true is 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