fix(webui): fit wide equations and refine math spacing (#6075)

* fix(webui): fit wide equations and refine math spacing

* refactor(webui): colocate display math styles with its component

* style(webui): trim math stylesheet trailing whitespace

* fix(webui): tighten spacing after display equations

* fix(webui): tighten spacing for equations within lists

* fix(webui): center responsive display equations
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-06 02:16:04 +08:00
1 parent d9ceae15be
commit 07c4e3f0d1
4 files changed
+181

No files matched your search

@@ -16,6 +16,7 @@ import remend from "remend";
import { parseMathAwareMarkdownBlocks } from "@/lib/markdown-streaming-blocks";
import { DisplayMath } from "@/components/DisplayMath";
import { AttachmentTile } from "@/components/AttachmentTile";
import { CodeBlock } from "@/components/CodeBlock";
import { WebLink } from "@/components/WebLink";
@@ -689,6 +690,13 @@ export default function MarkdownTextRenderer({
</WebLink>
);
},
span({ children: spanChildren, className: spanClassName, node: _node, ...props }) {
void _node;
if (spanClassName?.split(" ").includes("katex-display")) {
return <DisplayMath>{spanChildren}</DisplayMath>;
}
return <span className={spanClassName} {...props}>{spanChildren}</span>;
},
// Streamdown decorates emphasis with spans by default. Preserve native
// semantics for accessibility and predictable typography.
strong({ children: markdownChildren, node: _node, ...props }) {