Simpler calls to pypandoc

This commit is contained in:
Paul Gauthier 2024-02-08 16:11:42 -08:00
parent efff174f9a
commit bdef4308fe

View file

@ -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):