1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2026-03-17 09:52:29 +01:00

Add note about alt="" behavior

This commit is contained in:
David Lynch 2024-11-23 22:35:55 -06:00
parent 6988fc8ccc
commit 59923e0f63

View file

@ -132,6 +132,7 @@ def chapter_html(
else:
# Remove all images from the chapter so you don't get that annoying grey background.
for img in soup.find_all('img'):
# Note: alt="" will be completely removed here, which is consitent with the semantics
if img.parent.name.lower() == "figure":
# TODO: figcaption?
img.parent.replace_with(img.get('alt', '🖼'))