fix: cron_to_xmpp取最后一个Response节防误判(parts[1]→parts[-1])

This commit is contained in:
知微
2026-07-14 12:14:08 +08:00
parent 377bb4d1e4
commit c9ae1e143b
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ def extract_body(path):
return None
parts = content.split("## Response")
body = parts[1].strip() if len(parts) > 1 else content.strip()
body = parts[-1].strip() if len(parts) > 1 else content.strip()
body = re.sub(r'^#.*?\n', '', body, flags=re.MULTILINE).strip()
body = re.sub(r'\n?\s*<structured_data>.*?</structured_data>\s*', '', body, flags=re.DOTALL).strip()
body = re.sub(r'\*\*(.*?)\*\*', r'\1', body)
@@ -304,7 +304,7 @@ def scan():
continue
parts = content.split("## Response")
body = parts[1].strip() if len(parts) > 1 else content.strip()
body = parts[-1].strip() if len(parts) > 1 else content.strip()
body = re.sub(r'^#.*?\n', '', body, flags=re.MULTILINE).strip()
body = re.sub(r'\n?\s*<structured_data>.*?</structured_data>\s*', '', body, flags=re.DOTALL).strip()
body = re.sub(r'\*\*(.*?)\*\*', r'\1', body)
+2 -2
View File
@@ -148,7 +148,7 @@ def extract_body(path):
return None
parts = content.split("## Response")
body = parts[1].strip() if len(parts) > 1 else content.strip()
body = parts[-1].strip() if len(parts) > 1 else content.strip()
body = re.sub(r'^#.*?\n', '', body, flags=re.MULTILINE).strip()
body = re.sub(r'\n?\s*<structured_data>.*?</structured_data>\s*', '', body, flags=re.DOTALL).strip()
body = re.sub(r'\*\*(.*?)\*\*', r'\1', body)
@@ -304,7 +304,7 @@ def scan():
continue
parts = content.split("## Response")
body = parts[1].strip() if len(parts) > 1 else content.strip()
body = parts[-1].strip() if len(parts) > 1 else content.strip()
body = re.sub(r'^#.*?\n', '', body, flags=re.MULTILINE).strip()
body = re.sub(r'\n?\s*<structured_data>.*?</structured_data>\s*', '', body, flags=re.DOTALL).strip()
body = re.sub(r'\*\*(.*?)\*\*', r'\1', body)