interface Options {
    breaks?: boolean;
    highlight?: null | ((str, lang, attrs) => string);
    html?: boolean;
    langPrefix?: string;
    linkify?: boolean;
    quotes?: string | string[];
    typographer?: boolean;
    xhtmlOut?: boolean;
}

Properties

breaks?: boolean

Set true to convert \n in paragraphs into <br>.

Default

false
highlight?: null | ((str, lang, attrs) => string)

Highlighter function for fenced code blocks. Highlighter function (str, lang, attrs) should return escaped HTML. It can also return empty string if the source was not changed and should be escaped externally. If result starts with <pre... internal wrapper is skipped.

Type declaration

    • (str, lang, attrs): string
    • Parameters

      • str: string
      • lang: string
      • attrs: string

      Returns string

Default

null
html?: boolean

Set true to enable HTML tags in source. Be careful! That's not safe! You may need external sanitizer to protect output from XSS. It's better to extend features via plugins, instead of enabling HTML.

Default

false
langPrefix?: string

CSS language class prefix for fenced blocks. Can be useful for external highlighters.

Default

'language-'
linkify?: boolean

Set true to autoconvert URL-like text to links.

Default

false
quotes?: string | string[]

Double + single quotes replacement pairs, when typographer enabled and smartquotes on. For example, you can use '«»„“' for Russian, '„“‚‘' for German, and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).

Default

'“”‘’'
typographer?: boolean

Set true to enable some language-neutral replacement + quotes beautification (smartquotes).

Default

false
xhtmlOut?: boolean

Set true to add '/' when closing single tags (<br />). This is needed only for full CommonMark compatibility. In real world you will need HTML output.

Default

false

Generated using TypeDoc