mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +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
|
import pypandoc
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
from pypandoc.pandoc_download import download_pandoc
|
|
||||||
|
|
||||||
from aider import __version__
|
from aider import __version__
|
||||||
|
|
||||||
|
@ -111,15 +110,14 @@ class Scraper:
|
||||||
if self.pandoc_available:
|
if self.pandoc_available:
|
||||||
return
|
return
|
||||||
|
|
||||||
html = "<body></body>"
|
|
||||||
try:
|
try:
|
||||||
pypandoc.convert_text(html, "markdown", format="html")
|
pypandoc.get_pandoc_version()
|
||||||
self.pandoc_available = True
|
self.pandoc_available = True
|
||||||
return
|
return
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
download_pandoc()
|
pypandoc.download_pandoc()
|
||||||
self.pandoc_available = True
|
self.pandoc_available = True
|
||||||
|
|
||||||
def html_to_markdown(self, page_source):
|
def html_to_markdown(self, page_source):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue