From 3e8b35abf1713ea49b92d296b935e46fcf54ec15 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sat, 13 Jun 2020 23:14:03 +0800 Subject: [PATCH] Fix code highlight when copycode disabled --- source/js/next-boot.js | 2 +- source/js/utils.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/js/next-boot.js b/source/js/next-boot.js index 2876313..c83a681 100644 --- a/source/js/next-boot.js +++ b/source/js/next-boot.js @@ -88,7 +88,7 @@ NexT.boot.refresh = function() { CONFIG.pangu && window.pangu.spacingPage(); CONFIG.exturl && NexT.utils.registerExtURL(); - CONFIG.copycode.enable && NexT.utils.registerCopyCode(); + NexT.utils.registerCopyCode(); NexT.utils.registerTabsTag(); NexT.utils.registerActiveMenuItem(); NexT.utils.registerLangSelect(); diff --git a/source/js/utils.js b/source/js/utils.js index 8f19cc5..696f396 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -70,6 +70,7 @@ NexT.utils = { span.classList.add(`hljs-${name}`); }); }); + if (!CONFIG.copycode.enable) return; element.insertAdjacentHTML('beforeend', '