From 4df669b37c50e5e5688192b294f738e75154142f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Feb 2009 13:53:40 -0800 Subject: [PATCH] Fix #1792 (non-standard line-endings for "\n" in .epubs) --- src/calibre/ebooks/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index 9a273c42ce..e264fec7cb 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -467,7 +467,7 @@ class Parser(PreProcessor, LoggingInterface): if self.htmlfile.is_binary: raise ValueError('Not a valid HTML file: '+self.htmlfile.path) src = open(self.htmlfile.path, 'rb').read().decode(self.htmlfile.encoding, 'replace').strip() - src = src.replace('\x00', '') + src = src.replace('\x00', '').replace('\r', ' ') src = self.preprocess(src) # lxml chokes on unicode input when it contains encoding declarations for pat in ENCODING_PATS: