fix: 题面HTML提取范围扩大+清理标题前缀

这个提交包含在:
langxm
2026-10-14 20:46:22 +08:00
父节点 bbe01a9775
当前提交 eb3efccb3c
+2 -3
查看文件
@@ -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}