fix(webui): preserve TeX formula boundaries in streaming Markdown
This commit is contained in:
1 parent
d0d0a44e57
commit
810802e016
9 files changed
+329
-46
No files matched your search
@@ -14,6 +14,8 @@ import remarkMath from "remark-math";
|
||||
import { Streamdown, type Components, type StreamdownProps } from "streamdown";
|
||||
import remend from "remend";
|
||||
|
||||
import { parseMathAwareMarkdownBlocks } from "@/lib/markdown-streaming-blocks";
|
||||
|
||||
import { AttachmentTile } from "@/components/AttachmentTile";
|
||||
import { CodeBlock } from "@/components/CodeBlock";
|
||||
import { WebLink } from "@/components/WebLink";
|
||||
@@ -831,6 +833,7 @@ export default function MarkdownTextRenderer({
|
||||
key={needsMath && mathPlugin ? "math" : "text"}
|
||||
mode={streaming || preserveStreamingLayout ? "streaming" : "static"}
|
||||
parseIncompleteMarkdown={false}
|
||||
parseMarkdownIntoBlocksFn={parseMathAwareMarkdownBlocks}
|
||||
isAnimating={false}
|
||||
animated={false}
|
||||
linkSafety={DIRECT_LINKS}
|
||||
|
||||
Reference in new issue
Block a user