This commit is contained in:
Kovid Goyal 2021-07-14 17:14:04 +05:30
parent 9efcc37f16
commit f6517cc818
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -114,7 +114,7 @@ class TXTInput(InputFormatPlugin):
for img in root.xpath('//img[@src]'):
src = img.get('src')
prefix = src.split(':', 1)[0].lower()
if prefix not in ('file', 'http', 'https', 'ftp') and not os.path.isabs(src):
if src and prefix not in ('file', 'http', 'https', 'ftp') and not os.path.isabs(src):
src = os.path.join(base_dir, src)
if os.path.isfile(src) and os.access(src, os.R_OK):
with open(src, 'rb') as f: