diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 8ced8bb39..fd39baf76 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1,9 +1,9 @@ #!/usr/bin/env python import hashlib -import re import json import os +import re import sys import threading import time @@ -582,11 +582,14 @@ class Coder: def check_for_urls(self, inp): url_pattern = re.compile( - r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+' + r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+" ) urls = url_pattern.findall(inp) - if urls: - self.io.tool_output(f"Found URLs: {', '.join(urls)}") + for url in urls: + self.io.tool_output(f"Adding {url} to the chat.") + inp += "\n\n" + inp += self.commands.cmd_web(url) + return inp def keyboard_interrupt(self): diff --git a/aider/commands.py b/aider/commands.py index 146cb5dbd..898f8b699 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -69,8 +69,8 @@ class Commands: self.scraper = Scraper(print_error=self.io.tool_error) content = self.scraper.scrape(url) or "" - if content: - self.io.tool_output(content) + # if content: + # self.io.tool_output(content) instructions = self.scraper.get_playwright_instructions() if instructions: