From 567777d9654d5467efb698f643b59066d949518f Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 11 Aug 2020 09:38:16 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=90=AF=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A1=8C=E5=8F=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/common/comment/main.vue | 5 +++++ pages/article/_article_id.vue | 2 +- pages/article/post/_article_id.vue | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/common/comment/main.vue b/components/common/comment/main.vue index fdc9911..a4a7081 100644 --- a/components/common/comment/main.vue +++ b/components/common/comment/main.vue @@ -202,6 +202,11 @@ _ts.contentEditor.setValue(data.value ? data.value : ''); }, preview: { + hljs: { + enable: true, + lineNumber: true, + style: 'github' + }, markdown: { toc: true, }, diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index 948c7b8..f53a3de 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -199,7 +199,7 @@ // //const outLineElement = document.getElementById("articleToC"); // VditorPreview.setContentTheme('light'); Vue.VditorPreview.codeRender(previewElement, 'zh_CN'); - Vue.VditorPreview.highlightRender({"enable": true, "lineNumber": false, "style": "github"}, previewElement); + Vue.VditorPreview.highlightRender({"enable": true, "lineNumber": true, "style": "github"}, previewElement); Vue.VditorPreview.mathRender(previewElement, { math: {"engine": "KaTeX", "inlineDigit": false, "macros": {}}, }); diff --git a/pages/article/post/_article_id.vue b/pages/article/post/_article_id.vue index 3c936eb..544b0c2 100644 --- a/pages/article/post/_article_id.vue +++ b/pages/article/post/_article_id.vue @@ -145,6 +145,11 @@ _ts.contentEditor.setValue(data.value ? data.value : ''); }, preview: { + hljs: { + enable: true, + lineNumber: true, + style: 'github' + }, markdown: { toc: true, },