master
Aevann1 2021-12-05 01:05:12 +02:00
parent 62ce5d25bf
commit ae6579ad2c
1 changed files with 4 additions and 3 deletions

View File

@ -130,11 +130,12 @@ def sanitize(sanitized, noimages=False):
if site not in tag["src"] and not tag["src"].startswith('/'): tag["rel"] = "nofollow noopener noreferrer"
tag["class"] = "in-comment-image"
tag["loading"] = "lazy"
tag["data-src"] = tag["src"]
tag["src"] = "/assets/images/loading.webp"
# tag["data-src"] = tag["src"]
# tag["src"] = "/assets/images/loading.webp"
link = soup.new_tag("a")
link["href"] = tag["data-src"]
# link["href"] = tag["data-src"]
link["href"] = tag["src"]
if site not in link["href"] and not link["href"].startswith('/'): link["rel"] = "nofollow noopener noreferrer"
link["target"] = "_blank"
link["onclick"] = f"expandDesktopImage('{tag['data-src']}');"