also fix math formula enclosed in dollars

This commit is contained in:
dousha 2025-01-06 15:58:36 +08:00
parent b89f4e83fd
commit e94735125b

View File

@ -59,7 +59,7 @@ def fix_math_content(content):
def fix_math(content): def fix_math(content):
math_regex = re.compile(r'(\\[\[\(])(.+?)(\\[\)\]])') math_regex = re.compile(r'(\\[\[\(]|\${1,2}[^0-9])(.+?)(\${1,2}|\\[$\)\]])')
pos = 0 pos = 0
out = '' out = ''
while m := math_regex.search(content, pos): while m := math_regex.search(content, pos):