This commit is contained in:
rimu 2024-02-17 23:11:39 +13:00
parent a77de0c883
commit 03884aa534

View file

@ -193,6 +193,9 @@ def allowlist_html(html: str) -> str:
if tag.name == 'a': if tag.name == 'a':
tag.attrs['rel'] = 'nofollow ugc' tag.attrs['rel'] = 'nofollow ugc'
tag.attrs['target'] = '_blank' tag.attrs['target'] = '_blank'
# Add loading=lazy to images
if tag.name == 'img':
tag.attrs['loading'] = 'lazy'
return str(soup) return str(soup)