fix: 题面HTML提取范围扩大+清理标题前缀
这个提交包含在:
@@ -258,9 +258,8 @@ class HydroAdapter(BaseJudgeEngine):
|
|||||||
html = r.text
|
html = r.text
|
||||||
m = re.search(r'<h1 class="section__title">(.*?)</h1>', html, re.S)
|
m = re.search(r'<h1 class="section__title">(.*?)</h1>', html, re.S)
|
||||||
title = self._strip_html(m.group(1)).strip() if m else ""
|
title = self._strip_html(m.group(1)).strip() if m else ""
|
||||||
m = re.search(r'data-fragment-id="problem-description"[^>]*>(.*?)</div>\s*<div class="section', html, re.S)
|
title = re.sub(r'^#P\d+\.\s*', '', title) # 去掉面包屑 "#P142. " 前缀
|
||||||
if not m:
|
m = re.search(r'data-fragment-id="problem-description"[^>]*>(.{200,12000}?)(?=<div class="section|<footer|<div class="problem__aside)', html, re.S)
|
||||||
m = re.search(r'data-fragment-id="problem-description"[^>]*>(.*)', html, re.S)
|
|
||||||
content = self._strip_html(m.group(1)).strip() if m else ""
|
content = self._strip_html(m.group(1)).strip() if m else ""
|
||||||
return {"pid": str(pid), "title": title, "difficulty": 0, "content": content}
|
return {"pid": str(pid), "title": title, "difficulty": 0, "content": content}
|
||||||
|
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户