From 15c62e3e434252fdfbe46345050c04c71751be86 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 31 Oct 2024 14:01:41 -0700 Subject: [PATCH] fix: improve URL pattern to handle trailing commas in links --- aider/coders/base_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 47a895797..eec5a322a 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -793,7 +793,7 @@ class Coder: def check_and_open_urls(self, text: str) -> List[str]: """Check text for URLs and offer to open them in a browser.""" - url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*?)([.']*$|[.'\s])") + url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*?)([.']*$|[.',\s])") # ai strip trailing . or ' from the url! urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates