From 6f180708617de321f650a128aa68ba01514266f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 17 Jan 2017 18:08:33 +0530 Subject: [PATCH] HTML Input: Remove the # character from input filesnames, for maximum compatibility. Fixes #1656833 [Ebook-convert creates unreadable epub if there's a hash in the filename](https://bugs.launchpad.net/calibre/+bug/1656833) --- src/calibre/ebooks/conversion/plugins/html_input.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/html_input.py b/src/calibre/ebooks/conversion/plugins/html_input.py index 34ef4c2841..da30d823bc 100644 --- a/src/calibre/ebooks/conversion/plugins/html_input.py +++ b/src/calibre/ebooks/conversion/plugins/html_input.py @@ -20,7 +20,7 @@ from calibre.utils.imghdr import what def sanitize_file_name(x): - return re.sub(r'[?&=;]', '_', ascii_filename(x)) + return re.sub(r'[?&=;#]', '_', ascii_filename(x)) class HTMLInput(InputFormatPlugin): @@ -312,4 +312,3 @@ class HTMLInput(InputFormatPlugin): self.log.exception('Failed to read CSS file: %r'%link) return (None, None) return (None, raw) -