vue-markdown-editor
vue-markdown-editor copied to clipboard
扩展 markdown-it这么写对吗,为什么没有效果呢
VMdEditor.use(vuepressTheme, {
Prism,
Hljs: hljs,
codeHighlightExtensionMap: {
vue: 'html',
json: 'html'
},
extends(md) {
md.set({
html: true,
breaks: true
})
.use(MdEmjio, {
defs: svgMap,
shortcuts: Object.keys(svgMap).reduce<Record<string, string>>((obj, item) => {
obj[item] = icon:${item}
return obj
}, {})
})
.use(MdHContainer)
.use(MdContainer, 'header')
.use(MdContainer, 'left', {
render: function (tokens: any, idx: any) {
if (tokens[idx].nesting === 1) {
return '
'
} else {
return '
'
}
}
})
.use(MdContainer, 'right', {
render: function (tokens: any, idx: any) {
if (tokens[idx].nesting === 1) {
// opening tag
return ''
} else {
// closing tag
return '