interface
markdown.RenderCallbacks
interface RenderCallbacks
Callbacks for render(). Each callback receives the accumulated children as a string and optional metadata, and returns a string.
Return null or undefined to omit the element from the output. If no callback is registered for an element, its children pass through unchanged.
- code?: (children: string, meta?: CodeBlockMeta) => undefined | null | string
Code block.
meta.languageis the info-string (e.g."js"). Only passed for fenced code blocks with a language. - heading?: (children: string, meta: HeadingMeta) => undefined | null | string
Heading (level 1–6).
idis set whenheadings: { ids: true }is enabled. - listItem?: (children: string, meta: ListItemMeta) => undefined | null | string
List item.
metaalways includes{index, depth, ordered}.meta.startis set for ordered lists;meta.checkedis set for task list items.