1
0
mirror of https://github.com/ciromattia/kcc synced 2026-01-10 07:19:41 +00:00

Fixed handling filenames that start with dot (close #310)

This commit is contained in:
Paweł Jastrzębski
2019-08-04 09:25:32 +02:00
parent 50dc7fbffe
commit 4c13ef0f6c

View File

@@ -47,7 +47,7 @@ class HTMLStripper(HTMLParser):
def getImageFileName(imgfile):
name, ext = os.path.splitext(imgfile)
ext = ext.lower()
if name.startswith('.') or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
if (name.startswith('.') and len(name) == 1) or ext not in ['.png', '.jpg', '.jpeg', '.gif', '.webp']:
return None
return [name, ext]