fix(webui): preserve less-than comparisons in streaming math

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-09 11:38:40 +08:00
1 parent 92a297a6c8
commit c2f167bf78
2 files changed
+97 -4

No files matched your search

@@ -287,6 +287,9 @@ const remarkPlugins: NonNullable<StreamdownProps["remarkPlugins"]> = [
];
const rehypePlugins: NonNullable<StreamdownProps["rehypePlugins"]> = [rehypeKatex];
// Remend mistakes math comparisons like `j<i` for incomplete HTML and truncates
// the remaining text. HTML is handled by remarkSafeHtmlSubset, not raw rendering.
const REMEND_OPTIONS = { htmlTags: false } as const;
const DIRECT_LINKS = { enabled: false } as const;
const SAFE_MARKDOWN_PROTOCOL = /^(https?|ircs?|mailto|xmpp)$/i;
@@ -797,6 +800,7 @@ export default function MarkdownTextRenderer({
<Streamdown
mode={streaming ? "streaming" : "static"}
parseIncompleteMarkdown
remend={REMEND_OPTIONS}
isAnimating={false}
animated={false}
linkSafety={DIRECT_LINKS}