We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293557c commit a54e5a3Copy full SHA for a54e5a3
templates/types/streaming/nextjs/app/components/ui/chat/chat-message/markdown.tsx
@@ -17,12 +17,12 @@ const MemoizedReactMarkdown: FC<Options> = memo(
17
const preprocessLaTeX = (content: string) => {
18
// Replace block-level LaTeX delimiters \[ \] with $$ $$
19
const blockProcessedContent = content.replace(
20
- /\\\[(.*?)\\\]/gs,
+ /\\\[([\s\S]*?)\\\]/g,
21
(_, equation) => `$$${equation}$$`,
22
);
23
// Replace inline LaTeX delimiters \( \) with $ $
24
const inlineProcessedContent = blockProcessedContent.replace(
25
- /\\\((.*?)\\\)/gs,
26
(_, equation) => `$${equation}$`,
27
28
return inlineProcessedContent;
0 commit comments