Merge pull request #162 from molikai-work/main

🚑 为ai-chat组件渲染a标签时添加安全属性
This commit is contained in:
chaos-zhu
2025-04-06 15:54:25 +08:00
committed by GitHub
+7
View File
@@ -150,6 +150,13 @@ const md = new MarkdownIt({
}
})
md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
const token = tokens[idx]
token.attrSet('target', '_blank')
token.attrSet('rel', 'noopener noreferrer')
return self.renderToken(tokens, idx, options)
}
const { proxy: { $message, $store } } = getCurrentInstance()
const props = defineProps({