fix: restore markdown format
This commit is contained in:
@@ -148,3 +148,4 @@ export default function Navbar() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Download, Code2, Check, Copy } from 'lucide-react';
|
import { Download, Code2 } from 'lucide-react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import remarkMath from 'remark-math';
|
import remarkMath from 'remark-math';
|
||||||
import remarkBreaks from 'remark-breaks';
|
import remarkBreaks from 'remark-breaks';
|
||||||
@@ -55,6 +55,13 @@ function preprocessLatex(content: string): string {
|
|||||||
processed = processed.replace(/\\right\s+\)/g, '\\right)');
|
processed = processed.replace(/\\right\s+\)/g, '\\right)');
|
||||||
|
|
||||||
|
|
||||||
|
// Fix: \begin{matrix} with mismatched \left/\right -> use \begin{array}
|
||||||
|
// This is a more complex issue that requires proper \left/\right pairing
|
||||||
|
// For now, we'll try to convert problematic patterns
|
||||||
|
|
||||||
|
// Replace \left( ... \right. text \right) pattern with ( ... \right. text )
|
||||||
|
// This fixes the common mispairing issue
|
||||||
|
processed = processed.replace(/\\left\(([^)]*?)\\right\.\s*(\\text\{[^}]*\})\s*\\right\)/g, '($1\\right. $2)');
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user