From 7fec1aa9fdb314d17961b8ce75e8718e5a6fca92 Mon Sep 17 00:00:00 2001 From: Chen Xiao Date: Wed, 13 May 2026 14:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=BC=8F=E5=9D=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chen Xiao --- client/src/pages/MD2Doc.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/pages/MD2Doc.jsx b/client/src/pages/MD2Doc.jsx index 7c73013..8c12e27 100644 --- a/client/src/pages/MD2Doc.jsx +++ b/client/src/pages/MD2Doc.jsx @@ -372,7 +372,9 @@ export default function MD2Doc() { result = result.replace(/\\\(|\\\)/g, '$'); // 步骤4:\[ ... \] → $$ ... $$ - result = result.replace(/\\\[|\\\]/g, '$$'); + // 注意:在 JS 的 replace 中,'$$' 是特殊转义序列(表示插入字面量 '$'), + // 必须写成 '$$$$' 才能正确替换为两个 $ 符号 + result = result.replace(/\\\[|\\\]/g, '$$$$'); return result; };