Improved URL detection in check_for_urls function to exclude trailing commas and periods.

This commit is contained in:
Paul Gauthier (aider) 2024-07-12 17:21:14 +01:00
parent 02c3c4b8a0
commit a39ad76be0

View file

@ -669,7 +669,7 @@ class Coder:
def check_for_urls(self, inp):
url_pattern = re.compile(
r"(https?://[^\s/$.?#].[^\s]*)"
r"(https?://[^\s/$.?#].[^\s]*[^\s,.])"
)
urls = url_pattern.findall(inp)
for url in urls: