mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-04 21:00:36 +08:00
fix: md conversion
This commit is contained in:
parent
90347ff870
commit
5a45e9f2d8
@ -20,11 +20,12 @@ def convert_to_md(html: str, url: str = None) -> str:
|
||||
|
||||
Note: All the styles and links are ignored during the conversion. """
|
||||
|
||||
h = html2text.HTML2Text()
|
||||
h.ignore_links = False
|
||||
h.body_width = 0
|
||||
if url:
|
||||
parsed_url = urlparse(url)
|
||||
domain = f"{parsed_url.scheme}://{parsed_url.netloc}"
|
||||
h = html2text.HTML2Text()
|
||||
h.ignore_links = False
|
||||
h.baseurl = domain
|
||||
h.body_width = 0
|
||||
h.baseurl = domain
|
||||
|
||||
return h.handle(html)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user