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, },