mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-15 21:00:44 +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. """
|
Note: All the styles and links are ignored during the conversion. """
|
||||||
|
|
||||||
|
h = html2text.HTML2Text()
|
||||||
|
h.ignore_links = False
|
||||||
|
h.body_width = 0
|
||||||
if url:
|
if url:
|
||||||
parsed_url = urlparse(url)
|
parsed_url = urlparse(url)
|
||||||
domain = f"{parsed_url.scheme}://{parsed_url.netloc}"
|
domain = f"{parsed_url.scheme}://{parsed_url.netloc}"
|
||||||
h = html2text.HTML2Text()
|
h.baseurl = domain
|
||||||
h.ignore_links = False
|
|
||||||
h.baseurl = domain
|
|
||||||
h.body_width = 0
|
|
||||||
return h.handle(html)
|
return h.handle(html)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user