From b55d74fb124b90ee24d158bc94c401b0ff19edb9 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 13 May 2025 20:35:42 +0200 Subject: [PATCH] Update. --- src/snek/system/template.py | 2 +- src/snek/templates/web.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/snek/system/template.py b/src/snek/system/template.py index bad98fc..7026e6d 100644 --- a/src/snek/system/template.py +++ b/src/snek/system/template.py @@ -131,7 +131,7 @@ def enrich_image_rendering(text): soup = BeautifulSoup(text, "html.parser") for element in soup.find_all("img"): if element.attrs["src"].startswith("/" ): - element.attrs["src"] += "?width=420" + element.attrs["src"] += "?width=240" picture_template = f''' diff --git a/src/snek/templates/web.html b/src/snek/templates/web.html index a862d21..689efd3 100644 --- a/src/snek/templates/web.html +++ b/src/snek/templates/web.html @@ -331,7 +331,11 @@ overlay.style.zIndex = 9999; const fullImg = document.createElement('img'); - fullImg.src = img.src; + + const urlObj = new URL(img.src); + urlObj.search = '' + fullImg.src = urlObj.toString(); + fullImg.alt = img.alt; fullImg.style.maxWidth = '90%'; fullImg.style.maxHeight = '90%';