From 6e35002003e3197e0af74c87a4cf778e862405df Mon Sep 17 00:00:00 2001 From: BeADre Date: Tue, 31 Aug 2021 18:58:17 +0800 Subject: [PATCH] fix(markdown-loader): fix the bug of parse doc cause by template string --- packages/varlet-markdown-loader/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/varlet-markdown-loader/index.js b/packages/varlet-markdown-loader/index.js index f2dde45322f..a7ef6631b76 100644 --- a/packages/varlet-markdown-loader/index.js +++ b/packages/varlet-markdown-loader/index.js @@ -9,13 +9,12 @@ function cardWrapper(html) { function highlight(str, lang) { if (lang && hljs.getLanguage(lang)) { - return `
-         
-           
-           ${hljs.highlight(lang, str, true).value}
-         
-       
- ` + return ( + '
' +
+      '' +
+      hljs.highlight(lang, str, true).value +
+      '
' + ) } return ''