From 38ec3005e4fa523863bc853f67cc5398073f716d Mon Sep 17 00:00:00 2001 From: BeADre Date: Wed, 18 Nov 2020 21:27:58 +0800 Subject: [PATCH] feat(markdown-loader): addcard-warpper --- .../varlet-markdown-loader/markdownLoader.js | 3 ++- .../varlet-markdown-loader/src/card-wrapper.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 packages/varlet-markdown-loader/src/card-wrapper.js diff --git a/packages/varlet-markdown-loader/markdownLoader.js b/packages/varlet-markdown-loader/markdownLoader.js index a1210aefe03..bead26b5aea 100644 --- a/packages/varlet-markdown-loader/markdownLoader.js +++ b/packages/varlet-markdown-loader/markdownLoader.js @@ -1,5 +1,6 @@ const markdown = require('markdown-it') const hljs = require('highlight.js') +const cardWrapper = require('./src/card-wrapper.js') function highlight(str, lang) { if (lang && hljs.getLanguage(lang)) { @@ -19,7 +20,7 @@ function markLoader(source) { typographer: true, highlight, }) - const html = md.render(source) + const html = cardWrapper(md.render(source)) return ( '