批量收录题目时增加一个删除题目最后换行符的功能
This commit is contained in:
parent
adca519217
commit
9f2fa7e2e7
|
|
@ -190,6 +190,7 @@ def GenerateProblemListFromString(data): #从来自.tex文件的字符串生成
|
||||||
for pos in problempositions:
|
for pos in problempositions:
|
||||||
content = data[pos[0]:pos[1]].strip()
|
content = data[pos[0]:pos[1]].strip()
|
||||||
content = re.sub(r"\n\%[\s\S]*$","",content) #题目内容
|
content = re.sub(r"\n\%[\s\S]*$","",content) #题目内容
|
||||||
|
content = re.sub(r"\\\\$","",content) # 删去题目最后一行处可能存在的\\
|
||||||
subdata = data[:pos[0]] #开始寻找出处中缀
|
subdata = data[:pos[0]] #开始寻找出处中缀
|
||||||
suflist = re.findall(r"\n(\%\s{0,}[\S]+)\n",subdata)
|
suflist = re.findall(r"\n(\%\s{0,}[\S]+)\n",subdata)
|
||||||
if len(suflist) == 0:
|
if len(suflist) == 0:
|
||||||
|
|
|
||||||
Reference in New Issue