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):