Update.
This commit is contained in:
parent
a21e3590ef
commit
b55d74fb12
src/snek
@ -131,7 +131,7 @@ def enrich_image_rendering(text):
|
|||||||
soup = BeautifulSoup(text, "html.parser")
|
soup = BeautifulSoup(text, "html.parser")
|
||||||
for element in soup.find_all("img"):
|
for element in soup.find_all("img"):
|
||||||
if element.attrs["src"].startswith("/" ):
|
if element.attrs["src"].startswith("/" ):
|
||||||
element.attrs["src"] += "?width=420"
|
element.attrs["src"] += "?width=240"
|
||||||
picture_template = f'''
|
picture_template = f'''
|
||||||
<picture>
|
<picture>
|
||||||
<source srcset="{element.attrs["src"]}" type="{mimetypes.guess_type(element.attrs["src"])[0]}" />
|
<source srcset="{element.attrs["src"]}" type="{mimetypes.guess_type(element.attrs["src"])[0]}" />
|
||||||
|
@ -331,7 +331,11 @@
|
|||||||
overlay.style.zIndex = 9999;
|
overlay.style.zIndex = 9999;
|
||||||
|
|
||||||
const fullImg = document.createElement('img');
|
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.alt = img.alt;
|
||||||
fullImg.style.maxWidth = '90%';
|
fullImg.style.maxWidth = '90%';
|
||||||
fullImg.style.maxHeight = '90%';
|
fullImg.style.maxHeight = '90%';
|
||||||
|
Loading…
Reference in New Issue
Block a user