mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 03:35:00 +00:00
fix: update URL regex to strip trailing punctuation
This commit is contained in:
parent
9a37c0491d
commit
da706d9eb8
1 changed files with 1 additions and 1 deletions
|
@ -793,7 +793,7 @@ class Coder:
|
||||||
def check_and_open_urls(self, text: str) -> List[str]:
|
def check_and_open_urls(self, text: str) -> List[str]:
|
||||||
"""Check text for URLs and offer to open them in a browser."""
|
"""Check text for URLs and offer to open them in a browser."""
|
||||||
|
|
||||||
url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*)")
|
url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*?)([.']*$|[.'\s])")
|
||||||
#ai strip trailing . or ' from the url!
|
#ai strip trailing . or ' from the url!
|
||||||
|
|
||||||
urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates
|
urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue