EPUB Output: Remove <img> tags that point to the internet for their images as this causes the ever delicate ADE to crash. Fixes #4692 (epub file from NY Times (subscription) site crashes Sony PRS-700)

This commit is contained in:
Kovid Goyal 2010-01-29 12:58:07 -07:00
parent 79bb3ba005
commit d2b721e678

View File

@ -269,7 +269,7 @@ class EPUBOutput(OutputFormatPlugin):
bad = []
for x in XPath('//h:img')(body):
src = x.get('src', '').strip()
if src in ('', '#'):
if src in ('', '#') or src.startswith('http:'):
bad.append(x)
for img in bad:
img.getparent().remove(img)