feat: 为ai-chat组件渲染a标签时添加安全属性

This commit is contained in:
墨离
2025-04-06 14:04:36 +08:00
committed by GitHub
parent 41cf95b331
commit 38d3874d44
+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({