cte 10 ماه پیش
والد
کامیت
4898b4bb9e
1فایلهای تغییر یافته به همراه1 افزوده شده و 11 حذف شده
  1. 1 11
      webview-ui/src/components/ui/markdown/Markdown.tsx

+ 1 - 11
webview-ui/src/components/ui/markdown/Markdown.tsx

@@ -12,17 +12,7 @@ const MemoizedReactMarkdown: FC<Options> = memo(
 	(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className,
 )
 
-const preprocessLaTeX = (content: string) => {
-	// Replace block-level LaTeX delimiters \[ \] with $$ $$
-	const blockProcessedContent = content.replace(/\\\[([\s\S]*?)\\\]/g, (_, equation) => `$$${equation}$$`)
-
-	// Replace inline LaTeX delimiters \( \) with $ $
-	return blockProcessedContent.replace(/\\\[([\s\S]*?)\\\]/g, (_, equation) => `$${equation}$`)
-}
-
 export function Markdown({ content }: { content: string }) {
-	const processedContent = preprocessLaTeX(content)
-
 	return (
 		<MemoizedReactMarkdown
 			remarkPlugins={[remarkGfm]}
@@ -85,7 +75,7 @@ export function Markdown({ content }: { content: string }) {
 					)
 				},
 			}}>
-			{processedContent}
+			{content}
 		</MemoizedReactMarkdown>
 	)
 }