diff --git a/components/ChatMinimap.module.css b/components/ChatMinimap.module.css index 57735b33e..8cfd70e3c 100644 --- a/components/ChatMinimap.module.css +++ b/components/ChatMinimap.module.css @@ -139,6 +139,15 @@ gap: 0; } +.outline :global(.katex) { + font-size: 1em; +} + +.outline :global(.katex-display) { + display: inline; + margin: 0; +} + .heading, .paragraph { display: block; diff --git a/components/ChatMinimap.tsx b/components/ChatMinimap.tsx index 583ab34fc..b98437d03 100644 --- a/components/ChatMinimap.tsx +++ b/components/ChatMinimap.tsx @@ -2,7 +2,11 @@ import { memo, useEffect, useRef, useState, useCallback, useMemo, type RefObject } from "react"; import ReactMarkdown from "react-markdown"; -import { markdownPreviewRemarkPlugins } from "@/lib/markdown"; +import { + markdownPreviewRehypePlugins, + markdownPreviewRemarkPlugins, + normalizeDisplayMath, +} from "@/lib/markdown"; import { splitFinalAssistantBlocks } from "@/lib/message-display"; import type { AgentMessage, AssistantMessage, TextContent, UserMessage } from "@/lib/types"; import styles from "./ChatMinimap.module.css"; @@ -144,6 +148,7 @@ const AssistantOutline = memo(function AssistantOutline({
{children}, h2: ({ children, node }) => {children}, @@ -170,7 +175,7 @@ const AssistantOutline = memo(function AssistantOutline({ code: ({ children }) => <>{children}, }} > - {markdown} + {normalizeDisplayMath(markdown)}
);