feat: 渲染的链接新窗口打开

This commit is contained in:
ChenZhaoYu
2023-03-17 16:06:55 +08:00
parent 08b5772420
commit d422a805f6
4 changed files with 19 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
import { computed, ref } from 'vue'
import MarkdownIt from 'markdown-it'
import mdKatex from '@traptitech/markdown-it-katex'
import mila from 'markdown-it-link-attributes'
import hljs from 'highlight.js'
import { useBasicLayout } from '@/hooks/useBasicLayout'
import { t } from '@/locales'
@@ -31,6 +32,7 @@ const mdi = new MarkdownIt({
},
})
mdi.use(mila, { attrs: { target: '_blank', rel: 'noopener' } })
mdi.use(mdKatex, { blockClass: 'katexmath-block rounded-md p-[10px]', errorColor: ' #cc0000' })
const wrapClass = computed(() => {