md添加hightlight支持。

This commit is contained in:
539943419 committed 2025-01-20 23:42:33 +08:00
1 parent 63206e71b8
commit 72ba1691fb
6 files changed
+391 -24

No files matched your search

+12 -3
View File
@@ -33,15 +33,24 @@ const VNodeArr = computed(() => {
},
rander({
item,
tagName,
// tagName,
tagAttrs,
middlewareMap
// middlewareMap
}) {
// console.log({
// tagName,
// tagAttrs,
// })
const codeType = tagAttrs?.class?.slice(1, -1)?.split('-')?.[1] ?? ''
// console.log({
// codeType,
// })
return h(
codeMirror,
{
// @ts-ignore
data: (item.children[0].children as string).replaceAll('&lt;', '<').replaceAll('&gt;', '>'),
data: item.children[0].children.trim(),
type: codeType,
},
)
},