diff --git a/src/components/AiChat.vue b/src/components/AiChat.vue index e9f9bd9..b36e121 100644 --- a/src/components/AiChat.vue +++ b/src/components/AiChat.vue @@ -197,7 +197,7 @@ class="ai-msg-bubble ai-msg-bubble--ai ai-md" :class="{ 'ai-msg-bubble--error': msg.isError }" > -
+ @@ -344,14 +344,16 @@ function escapeHtml(text: string): string { return text.replace(/&/g, '&').replace(//g, '>') } -function renderMd(text: string): string { +function renderMd(text: string, isStreaming = false): string { if (!text) return '' + // 流式态纯文本(AR-1):避免每 delta 全量 marked.parse+sanitize 致主线程阻塞掉帧; + // 不缓存流式文本(每 delta 变,缓存无收益且污染),仅 escapeHtml + 换行转