mirror of
https://github.com/aykhans/portfolio-blog.git
synced 2025-09-08 15:10:45 +00:00
Added BeautifulSoup to html2text function
This commit is contained in:
@@ -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()
|
Reference in New Issue
Block a user