From 03884aa534a417a1e64f6c27b5ac15875bb0209a Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 17 Feb 2024 23:11:39 +1300 Subject: [PATCH] fixes #47 --- app/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/utils.py b/app/utils.py index f20d3893..cc8353e4 100644 --- a/app/utils.py +++ b/app/utils.py @@ -193,6 +193,9 @@ def allowlist_html(html: str) -> str: if tag.name == 'a': tag.attrs['rel'] = 'nofollow ugc' tag.attrs['target'] = '_blank' + # Add loading=lazy to images + if tag.name == 'img': + tag.attrs['loading'] = 'lazy' return str(soup)