mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
News download: Remove the srcset attribute from all images
It is useless and causes unnecessary network activity when reading books in viewer that support it. Also might be causing iBooks on iOS to refuse to display the images.
This commit is contained in:
parent
7fd413d392
commit
59bb0f8e55
@ -988,6 +988,11 @@ class BasicNewsRecipe(Recipe):
|
||||
for base in list(soup.findAll(['base', 'iframe', 'canvas', 'embed',
|
||||
'command', 'datalist', 'video', 'audio'])):
|
||||
base.extract()
|
||||
# srcset causes some viewers, like calibre's to load images from the
|
||||
# web, and it also possible causes iBooks on iOS to barf, see
|
||||
# https://bugs.launchpad.net/bugs/1713986
|
||||
for img in soup.findAll('img', srcset=True):
|
||||
del img['srcset']
|
||||
|
||||
ans = self.postprocess_html(soup, first_fetch)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user