Bun

interface

markdown.RenderCallbacks

interface RenderCallbacks

  • blockquote?: (children: string) => undefined | null | string

    Blockquote.

  • code?: (children: string, meta?: CodeBlockMeta) => undefined | null | string

    Code block. meta.language is the info-string (e.g. "js"). Only passed for fenced code blocks with a language.

  • codespan?: (children: string) => undefined | null | string

    Inline code (`code`).

  • emphasis?: (children: string) => undefined | null | string

    Emphasis (*text*).

  • heading?: (children: string, meta: HeadingMeta) => undefined | null | string

    Heading (level 1–6). id is set when headings: { ids: true } is enabled.

  • hr?: (children: string) => undefined | null | string

    Horizontal rule.

  • html?: (children: string) => undefined | null | string

    Raw HTML content.

  • image?: (children: string, meta: ImageMeta) => undefined | null | string

    Image. src is the URL, title is the optional title attribute.

  • list?: (children: string, meta: ListMeta) => undefined | null | string

    Ordered or unordered list. start is the first item number for ordered lists.

  • listItem?: (children: string, meta?: ListItemMeta) => undefined | null | string

    List item. meta.checked is set for task list items (- [x] / - [ ]). Only passed for task list items.

  • paragraph?: (children: string) => undefined | null | string

    Paragraph.

  • strikethrough?: (children: string) => undefined | null | string

    Strikethrough (~~text~~).

  • strong?: (children: string) => undefined | null | string

    Strong emphasis (**text**).

  • table?: (children: string) => undefined | null | string

    Table.

  • tbody?: (children: string) => undefined | null | string

    Table body.

  • td?: (children: string, meta?: CellMeta) => undefined | null | string

    Table data cell. meta.align is set when column alignment is specified.

  • text?: (text: string) => undefined | null | string

    Plain text content.

  • th?: (children: string, meta?: CellMeta) => undefined | null | string

    Table header cell. meta.align is set when column alignment is specified.

  • thead?: (children: string) => undefined | null | string

    Table head.

  • tr?: (children: string) => undefined | null | string

    Table row.