/** * The block grammar for `Markdown`: folds markdown source into an ordered list of * blocks. Pure and total — any string parses, and text that matches no block * construct becomes a paragraph rather than being discarded. */ /** The heading levels ATX syntax can express, `#` through `######`. */ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; /** A parsed block. Inline markup inside `text` is resolved at render time. */ export type MarkdownBlock = { readonly type: 'heading'; readonly level: HeadingLevel; readonly text: string; } | { readonly type: 'paragraph'; readonly text: string; } | { readonly type: 'code'; readonly language: string | undefined; readonly code: string; } | { readonly type: 'list'; readonly ordered: boolean; readonly items: readonly string[]; /** The first item's number on an ordered list, so the render can offset `