refac: tighten details and image patterns in background task message cleanup (#30394)

The patterns that remove details blocks and inline images from task messages now stop at the next details tag, bracket or parenthesis.
This commit is contained in:
Classic298
2026-09-23 23:55:07 -04:00
committed by GitHub
parent f7294161fa
commit 14c5b65704
+1 -1
View File
@@ -3865,7 +3865,7 @@ async def background_tasks_handler(ctx):
if isinstance(content, str):
content = re.sub(
r'<details\b[^>]*>.*?<\/details>|!\[.*?\]\(.*?\)',
r'<details\b[^<>]*>(?:(?!<details\b).)*?<\/details>|!\[[^\[\]]*\]\([^()]*\)',
'',
content,
flags=re.S | re.I,