镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 06:26:47 +00:00
remove debug msg
这个提交包含在:
@@ -212,15 +212,13 @@ def fix_code_segment_indent(txt):
|
||||
|
||||
def fix_dollar_sticking_bug(txt):
|
||||
"""
|
||||
修复不标准的dollar符号的问题
|
||||
修复不标准的dollar公式符号的问题
|
||||
"""
|
||||
txt_result = ""
|
||||
single_stack_height = 0
|
||||
double_stack_height = 0
|
||||
while True:
|
||||
while True:
|
||||
# still has $
|
||||
# how many dollar
|
||||
index = txt.find('$')
|
||||
|
||||
if index == -1:
|
||||
@@ -229,14 +227,14 @@ def fix_dollar_sticking_bug(txt):
|
||||
|
||||
if single_stack_height > 0:
|
||||
if txt[:(index+1)].find('\n') > 0 or txt[:(index+1)].find('<td>') > 0 or txt[:(index+1)].find('</td>') > 0:
|
||||
print('公式之中出现了异常换行 unexpect new line in equation')
|
||||
print('公式之中出现了异常 (Unexpect element in equation)')
|
||||
single_stack_height = 0
|
||||
txt_result += ' $'
|
||||
continue
|
||||
|
||||
if double_stack_height > 0:
|
||||
if txt[:(index+1)].find('\n\n') > 0:
|
||||
print('公式之中出现了异常换行 unexpect new line in equation')
|
||||
print('公式之中出现了异常 (Unexpect element in equation)')
|
||||
double_stack_height = 0
|
||||
txt_result += '$$'
|
||||
continue
|
||||
@@ -255,15 +253,13 @@ def fix_dollar_sticking_bug(txt):
|
||||
txt = txt[(index+2):]
|
||||
else:
|
||||
if double_stack_height != 0:
|
||||
print(txt[:(index)])
|
||||
print('Fatal')
|
||||
# print(txt[:(index)])
|
||||
print('发现异常嵌套公式')
|
||||
if single_stack_height == 0:
|
||||
single_stack_height = 1
|
||||
else:
|
||||
single_stack_height = 0
|
||||
print(txt[:(index)])
|
||||
import time
|
||||
# time.sleep(0.1)
|
||||
# print(txt[:(index)])
|
||||
txt_result += txt[:(index+1)]
|
||||
txt = txt[(index+1):]
|
||||
break
|
||||
|
||||
在新工单中引用
屏蔽一个用户