修复语法错误:else后不能直接跟elif

- 问题:Task #1685修复引入语法错误,else:后直接跟elif导致SyntaxError
- 修复:调整代码结构,将elif正确嵌套在if not _has_table_structure:块内
This commit is contained in:
youpaishidifu
2026-09-02 17:29:55 +08:00
parent 3245e790c5
commit 7a2d99ba36
+2 -2
View File
@@ -8631,8 +8631,6 @@ class MessageMonitor:
# 纯配置文本,丢弃
logger.debug(f"[ocr] 过滤器2结果: 检测到多条配置文件格式({len(_colon_matches)}条key:value),返回True: {text!r}")
return True
else:
logger.debug(f"[ocr] 过滤器2结果: 检测到表格结构,跳过key:value配置文件检测: {text[:80]!r}")
elif len(_colon_matches) == 1:
# 单条key:value,检查是否为完整的一条(无多余字符)
_colon_match = re.match(r'^[\u4e00-\u9fff]{2,10}\s*[::]\s*\S+$', text)
@@ -8658,6 +8656,8 @@ class MessageMonitor:
else:
logger.debug(f"[ocr] 过滤器2结果: 检测到单条配置文件格式(key: value),返回True: {text!r}")
return True
else:
logger.debug(f"[ocr] 过滤器2结果: 检测到表格结构,跳过key:value配置文件检测: {text[:80]!r}")
# 3. 检测其他配置文件格式:等号分隔的键值对(如key=value)
# ⭐ Task #1685: 跳过表格结构内容
if not _has_table_structure: