Expand description
interface MarkdownItOptions {
html?: boolean;
xhtmlOut?: boolean;
breaks?: boolean;
langPrefix?: string;
linkify?: boolean;
typographer?: boolean;
quotes?: string | string[];
highlight?: ((str: string, lang: string, attrs: string) => string) | null;
maxNesting?: number;
}
Properties§
html?: boolean
Enable HTML tags in source.
xhtml Out?: boolean
Use '/' to close single tags (<br />).
breaks?: boolean
Convert '\n' in paragraphs into <br>.
lang Prefix?: string
CSS language prefix for fenced blocks, used by external syntax highlighters.
linkify?: boolean
Autoconvert URL-like text to links.
typographer?: boolean
Enable language-neutral replacements and quotes beautification.
See the replacement rules for the full list.
quotes?: string | string[]
Double + single quotes replacement pairs, when typographer is enabled and smartquotes are on. Can be either a string or an array.
For example, use '«»„“' for Russian, '„“‚‘' for German, and
['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
highlight?: ((str: string, lang: string, attrs: string) => string) | null
Highlighter function. Should return escaped HTML, or an empty string if
the source string was not changed and should be escaped externally.
If the result starts with <pre, the internal wrapper is skipped.
The highlighter is called by the default fence renderer rule. If needed,
you can replace that renderer rule completely; see the
renderer source.
max Nesting?: number
Internal protection against excessive recursion.
Options controlling Markdown parsing and rendering.