Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Only remove empty links

Magnus Müllera212727249b5
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index a2560e099..230241ad0 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -374,7 +374,7 @@ class Controller(Generic[Context]):
content = re.sub(r'❓\s*\[\d+\]\s*\w+.*?Position:.*?Size:.*?\n?', '', content, flags=re.MULTILINE | re.DOTALL)
content = re.sub(r'Primary: UNKNOWN\n\nNo specific evidence found', '', content, flags=re.MULTILINE | re.DOTALL)
content = re.sub(r'UNKNOWN CONFIDENCE', '', content, flags=re.MULTILINE | re.DOTALL)
- content = re.sub(r'!\[.*?\]', '', content, flags=re.MULTILINE | re.DOTALL)
+ content = re.sub(r'!\[\]\(\)', '', content, flags=re.MULTILINE | re.DOTALL)
except Exception as e:
raise RuntimeError(f'Could not convert html to markdown: {type(e).__name__}')