markdown-it - v15.0.2
    Preparing search index...

    Interface MarkdownItOptions

    Options controlling Markdown parsing and rendering.

    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;
    }
    Index

    Enable HTML tags in source.

    false (true for 'commonmark' preset only)

    Use '/' to close single tags (<br />).

    false (true for 'commonmark' preset only)

    Convert '\n' in paragraphs into <br>.

    false

    CSS language prefix for fenced blocks, used by external syntax highlighters.

    'language-'

    Autoconvert URL-like text to links.

    false

    Enable language-neutral replacements and quotes beautification.

    See the replacement rules for the full list.

    false

    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).

    '“”‘’'

    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.

    import MarkdownIt from 'markdown-it'
    import hljs from 'highlight.js' // https://highlightjs.org

    const md = new MarkdownIt({
    highlight: function (str, lang) {
    if (lang && hljs.getLanguage(lang)) {
    try {
    return hljs.highlight(str, { language: lang }).value
    } catch (__) {}
    }

    return '' // use external default escaping
    }
    });

    Or with full wrapper override (if you need assign class to <pre> or <code>):

    import MarkdownIt from 'markdown-it'
    import hljs from 'highlight.js' // https://highlightjs.org

    const md = new MarkdownIt({
    highlight: function (str, lang) {
    if (lang && hljs.getLanguage(lang)) {
    try {
    return `<pre><code class="hljs">${hljs.highlight(str,
    { language: lang, ignoreIllegals: true }).value}</code></pre>`
    } catch (__) {}
    }

    return `<pre><code class="hljs">${md.utils.escapeHtml(str)}</code></pre>`
    }
    });

    null

    Internal protection against excessive recursion.

    100