mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
Desktop assistant responses previously showed LaTeX source for common model outputs. The markdown renderer now extracts math outside code spans and fences, renders it through KaTeX, and applies chat-safe layout rules for inline, block, multiline, matrix, and long-form formulas. Constraint: Desktop chat already forces long markdown text to wrap, so KaTeX internals must opt out of that wrapping while display blocks handle overflow locally Rejected: Render all dollar-delimited text blindly | currency and escaped dollar text would become false-positive formulas Confidence: high Scope-risk: narrow Directive: Keep math extraction before marked parsing and preserve code fence protection when extending markdown rendering Tested: bun run test --run src/components/markdown/MarkdownRenderer.test.tsx Tested: bun run lint Tested: bun run build Tested: WebUI complex formula screenshot and 390px viewport overflow check Not-tested: Full desktop gate still has unrelated /goal command hint expectation drift