Skip to content

Commit

Permalink
Modify renderer.js
Browse files Browse the repository at this point in the history
Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated.
Please use highlight(code, options) instead.
highlightjs/highlight.js#2277
  • Loading branch information
vsouild authored and CHENXCHEN committed Aug 8, 2022
1 parent 3138f16 commit 15b43ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function checkConfig(config, md) {
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>';
return '<pre class="' + pre_class + '"><code class="' + lang + '">' + hljs.highlight(str, {language: lang, ignoreIllegals: true }).value + '</code></pre>';
} catch (__) {}
}
return '<pre class="' + pre_class + '"><code class="' + lang + '">' + utils.escapeHtml(str) + '</code></pre>';
Expand Down

0 comments on commit 15b43ac

Please sign in to comment.