From c9ae1e143bc0ba04dccf94e19a5fbc85c38876ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Tue, 14 Jul 2026 12:14:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cron=5Fto=5Fxmpp=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AAResponse=E8=8A=82=E9=98=B2=E8=AF=AF?= =?UTF-8?q?=E5=88=A4=EF=BC=88parts[1]=E2=86=92parts[-1]=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron_to_xmpp.py | 4 ++-- scripts/cron_to_xmpp.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cron_to_xmpp.py b/cron_to_xmpp.py index e32acf1e..b37f7292 100644 --- a/cron_to_xmpp.py +++ b/cron_to_xmpp.py @@ -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*.*?\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*.*?\s*', '', body, flags=re.DOTALL).strip() body = re.sub(r'\*\*(.*?)\*\*', r'\1', body) diff --git a/scripts/cron_to_xmpp.py b/scripts/cron_to_xmpp.py index 2365193b..3fa286f0 100644 --- a/scripts/cron_to_xmpp.py +++ b/scripts/cron_to_xmpp.py @@ -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*.*?\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*.*?\s*', '', body, flags=re.DOTALL).strip() body = re.sub(r'\*\*(.*?)\*\*', r'\1', body)