mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
style: format code with linter
This commit is contained in:
parent
2f4dd04164
commit
5cab55c74b
1 changed files with 10 additions and 9 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
import re
|
||||
import sys
|
||||
import re
|
||||
|
||||
import pypandoc
|
||||
|
||||
|
@ -104,7 +103,9 @@ class Scraper:
|
|||
return None
|
||||
|
||||
# Check if the content is HTML based on MIME type or content
|
||||
if (mime_type and mime_type.startswith("text/html")) or (mime_type is None and self.looks_like_html(content)):
|
||||
if (mime_type and mime_type.startswith("text/html")) or (
|
||||
mime_type is None and self.looks_like_html(content)
|
||||
):
|
||||
self.try_pandoc()
|
||||
content = self.html_to_markdown(content)
|
||||
|
||||
|
@ -117,13 +118,13 @@ class Scraper:
|
|||
if isinstance(content, str):
|
||||
# Check for common HTML tags
|
||||
html_patterns = [
|
||||
r'<!DOCTYPE\s+html',
|
||||
r'<html',
|
||||
r'<head',
|
||||
r'<body',
|
||||
r'<div',
|
||||
r'<p>',
|
||||
r'<a\s+href=',
|
||||
r"<!DOCTYPE\s+html",
|
||||
r"<html",
|
||||
r"<head",
|
||||
r"<body",
|
||||
r"<div",
|
||||
r"<p>",
|
||||
r"<a\s+href=",
|
||||
]
|
||||
return any(re.search(pattern, content, re.IGNORECASE) for pattern in html_patterns)
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue