mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00: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:
parent
f7294161fa
commit
14c5b65704
1 changed files with 1 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue