How to use the markdown-it/lib/common/utils.escapeHtml function in markdown-it

To help you get started, we’ve selected a few markdown-it examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CHENXCHEN / hexo-renderer-markdown-it-plus / lib / renderer.js View on Github external
checkValue(config, _res, 'highlight', function(str, lang) {
        if (lang && hljs.getLanguage(lang)) {
            try {
                return '<pre class="' + pre_class + '"><code class="' + lang + '">' + hljs.highlight(lang, str, true).value + '</code></pre>';
            } catch (__) {}
        }
        return '<pre class="' + pre_class + '"><code class="' + lang + '">' + utils.escapeHtml(str) + '</code></pre>';
    }, function(str, lang) {
        return '<pre class="' + pre_class + '"><code class="' + lang + '">' + utils.escapeHtml(str) + '</code></pre>';