mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-28 02:07:05 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user