Spaces:
Sleeping
Sleeping
fix latex
Browse files
web/src/mathjax-config.ts
CHANGED
|
@@ -117,7 +117,7 @@ export function preprocessMathContent(content: string): string {
|
|
| 117 |
// 2. Not already in $ delimiters
|
| 118 |
// 3. Not inside code blocks
|
| 119 |
processed = processed.replace(
|
| 120 |
-
/^(?!\s*\$)(\s*\\(?:frac|le|ge|sqrt|cdot|ln|text|quad|implies|iff|ne|in|sum|prod|int|lim|infty|alpha|beta|gamma|delta|epsilon|theta|phi|psi|omega|mathbb|mathrm|begin|end)[^\n$]+)$/gm,
|
| 121 |
(match) => {
|
| 122 |
// Check if it looks like a standalone math expression
|
| 123 |
// Count backslash commands - if 2 or more, it's likely math
|
|
|
|
| 117 |
// 2. Not already in $ delimiters
|
| 118 |
// 3. Not inside code blocks
|
| 119 |
processed = processed.replace(
|
| 120 |
+
/^(?!\s*\$)(\s*\\(?:frac|le|ge|sqrt|cdot|ln|text|quad|implies|iff|ne|in|sum|prod|int|oint|iint|iiint|lim|infty|alpha|beta|gamma|delta|epsilon|theta|phi|psi|omega|mathbb|mathbf|mathrm|begin|end|partial|left|right|times)[^\n$]+)$/gm,
|
| 121 |
(match) => {
|
| 122 |
// Check if it looks like a standalone math expression
|
| 123 |
// Count backslash commands - if 2 or more, it's likely math
|