mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
Simpler calls to pypandoc
This commit is contained in:
parent
efff174f9a
commit
bdef4308fe
1 changed files with 2 additions and 4 deletions
|
@ -7,7 +7,6 @@ import httpx
|
|||
import pypandoc
|
||||
from bs4 import BeautifulSoup
|
||||
from playwright.sync_api import sync_playwright
|
||||
from pypandoc.pandoc_download import download_pandoc
|
||||
|
||||
from aider import __version__
|
||||
|
||||
|
@ -111,15 +110,14 @@ class Scraper:
|
|||
if self.pandoc_available:
|
||||
return
|
||||
|
||||
html = "<body></body>"
|
||||
try:
|
||||
pypandoc.convert_text(html, "markdown", format="html")
|
||||
pypandoc.get_pandoc_version()
|
||||
self.pandoc_available = True
|
||||
return
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
download_pandoc()
|
||||
pypandoc.download_pandoc()
|
||||
self.pandoc_available = True
|
||||
|
||||
def html_to_markdown(self, page_source):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue