From ebd93005b71c423305e8c811b7867ce1b92e4aa9 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Thu, 10 Dec 2020 10:13:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/md-parser.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/md-parser.js b/scripts/md-parser.js index a1e339c33..1b9676139 100644 --- a/scripts/md-parser.js +++ b/scripts/md-parser.js @@ -159,7 +159,9 @@ module.exports = function (content, file) { placeholder[ index ] = `
${code}
${prism.highlight(
-          code.replace(/"data:(\w+\/\w+);.*?"/g, '"data:$1; ..."'),
+          code
+            .replace(/"data:(\w+\/\w+);.*?"/g, '"data:$1; ..."')
+            .replace(/]*)>[\s\S]*?<\/svg>/g, '...'),
           prism.languages[lang],
           lang
         )}
`; @@ -181,12 +183,12 @@ module.exports = function (content, file) { // + `\n\n
文档内容有误?欢迎大家一起来编写,文档地址:${file.subpath}
`; info.html = '
' + - content.replace(/<\!\-\-amis\-preview\-(start|end)\-\-\>/g, function ( - _, - type - ) { - return type === 'start' ? '
' : '
'; - }) + + content.replace( + /<\!\-\-amis\-preview\-(start|end)\-\-\>/g, + function (_, type) { + return type === 'start' ? '
' : '
'; + } + ) + '
'; info.toc = toc;