keep hrefs

This commit is contained in:
Paul Gauthier 2024-02-08 15:19:00 -08:00
parent 62c67a1e23
commit 2dee76378b

View file

@ -134,7 +134,9 @@ def slimdown_html(soup):
tag.decompose()
for tag in soup.find_all(True):
tag.attrs.clear()
for attr in list(tag.attrs):
if attr != "href":
tag.attrs.pop(attr, None)
return soup