1
0
mirror of https://github.com/osmarks/random-stuff synced 2025-11-18 14:35:14 +00:00

change things in some way

This commit is contained in:
osmarks
2025-05-18 14:09:06 +01:00
parent d057781e3c
commit f32abdf5b6
12 changed files with 672 additions and 45 deletions

View File

@@ -99,7 +99,10 @@ def clean_html(html):
remove_unknown_tags=True,
safe_attrs_only=True
)
return cleaner.clean_html(feedparser.sanitizer._sanitize_html(html.replace("<!doctype html>", ""), "utf-8", "text/html"))
try:
return cleaner.clean_html(feedparser.sanitizer._sanitize_html(html.replace("<!doctype html>", ""), "utf-8", "text/html"))
except:
return "HTML parse error"
def email_to_html(emsg, debug_info=False):
if isinstance(emsg, Message):