diff --git a/Yi.Ai.Vue3/.claude/settings.local.json b/Yi.Ai.Vue3/.claude/settings.local.json index 89b03152..842aaa71 100644 --- a/Yi.Ai.Vue3/.claude/settings.local.json +++ b/Yi.Ai.Vue3/.claude/settings.local.json @@ -10,7 +10,9 @@ "Bash(npm install marked --save)", "Bash(pnpm add marked)", "Bash(pnpm lint:*)", - "Bash(pnpm list:*)" + "Bash(pnpm list:*)", + "Bash(pnpm vue-tsc:*)", + "Bash(pnpm build:*)" ], "deny": [], "ask": [] diff --git a/Yi.Ai.Vue3/src/components/MarkedMarkdown/index.vue b/Yi.Ai.Vue3/src/components/MarkedMarkdown/index.vue index 6609df93..f0954924 100644 --- a/Yi.Ai.Vue3/src/components/MarkedMarkdown/index.vue +++ b/Yi.Ai.Vue3/src/components/MarkedMarkdown/index.vue @@ -10,11 +10,13 @@ import { useDesignStore } from '@/stores'; interface Props { content: string; theme?: 'light' | 'dark' | 'auto'; + sanitize?: boolean; } const props = withDefaults(defineProps(), { content: '', theme: 'auto', + sanitize: true, }); const designStore = useDesignStore(); @@ -94,7 +96,12 @@ const renderer = { // 行内代码 codespan(token: { text: string }) { - return `${token.text}`; + // 转义 HTML 标签,防止