Added BeautifulSoup to html2text function

This commit is contained in:
aykhan committed 2023-09-13 23:46:11 +04:00
1 parent b74bac45f5
commit fc0551f7dc
3 files changed
+34 -7

No files matched your search

+3 -6
View File
@@ -1,9 +1,6 @@
import re
from bs4 import BeautifulSoup
def html2text(html: str) -> str:
return re.sub(
re.compile('<.*?>'),
'',
html
)
soup = BeautifulSoup(html, 'html.parser')
return soup.get_text()