mirror of
https://github.com/kemayo/leech
synced 2025-12-06 16:33:16 +01:00
Fix some images not having srcset and sizes removed
This commit is contained in:
parent
746ec1b994
commit
d49d7891c3
1 changed files with 2 additions and 1 deletions
|
|
@ -297,11 +297,12 @@ class Site:
|
|||
tag['style'] = re.sub(r'(?:color|background)\s*:[^;]+;?', '', tag['style'])
|
||||
|
||||
if base:
|
||||
for img in contents.find_all('img', src=lambda src: not src.startswith('http')):
|
||||
for img in contents.find_all('img', src=True):
|
||||
# Later epub processing needs absolute image URLs
|
||||
# print("fixing img src", img['src'], self._join_url(base, img['src']))
|
||||
img['src'] = self._join_url(base, img['src'])
|
||||
del img['srcset']
|
||||
del img['sizes']
|
||||
|
||||
return contents
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue