This commit is contained in:
Kovid Goyal 2018-08-22 08:31:28 +05:30
parent 6a7c77c41c
commit aae106cdf3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -22,7 +22,7 @@ from calibre.utils.imghdr import what
def sanitize_file_name(x):
ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.')
ans, ext = ans.rpartition('.')[::2]
return ans.strip() + '.' + ext.strip()
return (ans.strip() + '.' + ext.strip()).rstrip('.')
class HTMLInput(InputFormatPlugin):