mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1792 (non-standard line-endings for "\n" in .epubs)
This commit is contained in:
parent
1145b768dc
commit
4df669b37c
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user