From 59923e0f63f9496cf9cd50ed7db7f04adf069c42 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Sat, 23 Nov 2024 22:35:55 -0600 Subject: [PATCH] Add note about alt="" behavior --- ebook/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ebook/__init__.py b/ebook/__init__.py index 893cc7e..e064d1b 100644 --- a/ebook/__init__.py +++ b/ebook/__init__.py @@ -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', '🖼'))