bugfix/youtube-embed #37

Merged
retoor merged 6 commits from :bugfix/youtube-embed into main 2025-05-20 22:02:17 +02:00
Showing only changes of commit 1bed47fbf5 - Show all commits

View File

@ -181,7 +181,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=240&height=240" element.attrs["src"] += "?width=240&height=240&format=webp"
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]}" />