mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
feat: add error handling for pypandoc conversion in Scraper class
This commit is contained in:
parent
be1e45a4b3
commit
ef4a9dc4ca
1 changed files with 4 additions and 1 deletions
|
@ -222,7 +222,10 @@ class Scraper:
|
||||||
if not self.pandoc_available:
|
if not self.pandoc_available:
|
||||||
return page_source
|
return page_source
|
||||||
|
|
||||||
md = pypandoc.convert_text(page_source, "markdown", format="html")
|
try:
|
||||||
|
md = pypandoc.convert_text(page_source, "markdown", format="html")
|
||||||
|
except OSError:
|
||||||
|
return page_source
|
||||||
|
|
||||||
md = re.sub(r"</div>", " ", md)
|
md = re.sub(r"</div>", " ", md)
|
||||||
md = re.sub(r"<div>", " ", md)
|
md = re.sub(r"<div>", " ", md)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue