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)