From 15b43ac7c3d30f2eba1fd7177b044baf191d615e Mon Sep 17 00:00:00 2001 From: Vsouild <360301524@qq.com> Date: Thu, 4 Aug 2022 02:33:18 +0800 Subject: [PATCH] Modify renderer.js Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277 --- lib/renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/renderer.js b/lib/renderer.js index 90cbc4d..14a740e 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -55,7 +55,7 @@ function checkConfig(config, md) { checkValue(config, _res, 'highlight', function(str, lang) { if (lang && hljs.getLanguage(lang)) { try { - return '
' + hljs.highlight(lang, str, true).value + '
'; + return '
' + hljs.highlight(str, {language: lang, ignoreIllegals: true }).value + '
'; } catch (__) {} } return '
' + utils.escapeHtml(str) + '
';