From e94735125bd769ba5bcd5948afffef20e0441f82 Mon Sep 17 00:00:00 2001 From: dousha Date: Mon, 6 Jan 2025 15:58:36 +0800 Subject: [PATCH] also fix math formula enclosed in dollars --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f8b7608..7fe2f1e 100644 --- a/main.py +++ b/main.py @@ -59,7 +59,7 @@ def fix_math_content(content): def fix_math(content): - math_regex = re.compile(r'(\\[\[\(])(.+?)(\\[\)\]])') + math_regex = re.compile(r'(\\[\[\(]|\${1,2}[^0-9])(.+?)(\${1,2}|\\[$\)\]])') pos = 0 out = '' while m := math_regex.search(content, pos):