fix: cron_to_xmpp取最后一个Response节防误判(parts[1]→parts[-1])
This commit is contained in:
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user