Hierarchy

Properties

baseUrl?: string

A prefix URL for any relative link.

breaks?: boolean

Enable GFM line breaks. This option requires the gfm option to be true.

gfm?: boolean

Enable GitHub flavored markdown.

headerIds?: boolean

Include an id attribute when emitting headings.

headerPrefix?: string

Set the prefix for header tag ids.

langPrefix?: string

Set the prefix for code block classes.

mangle?: boolean

Mangle autolinks (email@domain.com).

pedantic?: boolean

Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.

renderer?: Renderer<never>

Type: object Default: new Renderer()

An object containing functions to render tokens to HTML.

sanitize?: boolean

Sanitize the output. Ignore any HTML that has been input.

silent?: boolean

Shows an HTML error message when rendering fails.

smartLists?: boolean

Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.

smartypants?: boolean

Use "smart" typograhic punctuation for things like quotes and dashes.

tokenizer?: Tokenizer<never>

The tokenizer defines how to turn markdown text into tokens.

walkTokens?: ((token) => void)

Type declaration

    • (token): void
    • The walkTokens function gets called with every token. Child tokens are called before moving on to sibling tokens. Each token is passed by reference so updates are persisted when passed to the parser. The return value of the function is ignored.

      Parameters

      Returns void

xhtml?: boolean

Generate closing slash for self-closing tags (
instead of
)

Methods

  • A function to highlight code blocks. The function can either be synchronous (returning a string) or asynchronous (callback invoked with an error if any occurred during highlighting and a string if highlighting was successful)

    Parameters

    • code: string
    • lang: string
    • Optional callback: ((error, code?) => void)
        • (error, code?): void
        • Parameters

          • error: any
          • Optional code: string

          Returns void

    Returns string | void

  • Optionally sanitize found HTML with a sanitizer function.

    Parameters

    • html: string

    Returns string

Generated using TypeDoc