QingWei-Li / vue-markdown-loader

📇 Convert Markdown file to Vue2.0 component.
704 stars 161 forks source link

markdown-it config not worked #45

Closed ideagay closed 6 years ago

ideagay commented 6 years ago

webpack.config.js

const hljs = require('highlight.js'); const markdown = require('markdown-it')({ html: true, breaks: true, wrapper: 'section', preprocess: function (MarkdownIt, Source) { return Source; }, highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { try { return '

' +
hljs.highlight(lang, str, true).value +
'
'; } catch (__) {} } return '
' + markdown.utils.escapeHtml(str) + '
'; } }); markdown.use(require('markdown-it-emoji'));

...{ test: /.md$/, loader: 'vue-markdown-loader', options: markdown }

but the wrapper was undefined and the hightlight was not worked image

wxy1234567890 commented 2 years ago

markdown-it-emoji怎么在Vue CLI 3的vue.config.js file中配置