fix: LaTeX formulas flash and disappear during streaming response (#1056)

Replace token-by-token rendering (marked.lexer + v-for + marked.parser)
with single-pass marked.parse() in botmsg.vue and AgentStreamDisplay.vue.
This prevents Vue's v-for keyed diffing from destroying KaTeX DOM nodes
on each streaming update.

Also adds a dev-only markdown test page (/platform/dev/markdown) with
LaTeX, code, tables, Mermaid, and streaming simulation for visual
regression testing.
This commit is contained in:
wizardchen
2026-04-28 19:30:51 +08:00
committed by lyingbug
parent 1f03741462
commit 4b87239929
4 changed files with 509 additions and 60 deletions
+7
View File
@@ -131,6 +131,13 @@ const router = createRouter({
},
],
},
// Dev-only markdown rendering test page
...(import.meta.env.DEV ? [{
path: '/platform/dev/markdown',
name: 'markdownTest',
component: () => import('../views/dev/MarkdownTestPage.vue'),
meta: { requiresAuth: false, requiresInit: false }
}] : []),
],
});