mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
TXT Output: Do not fail when input contains HTML comments with double hyphens in the comment text.
This commit is contained in:
parent
e1c1e617bc
commit
156058f295
@ -68,6 +68,9 @@ class TXTMLizer(object):
|
||||
output.append(self.get_toc())
|
||||
for item in self.oeb_book.spine:
|
||||
self.log.debug('Converting %s to TXT...' % item.href)
|
||||
for x in item.data.iterdescendants(etree.Comment):
|
||||
if x.text and '--' in x.text:
|
||||
x.text = x.text.replace('--', '__')
|
||||
content = unicode(etree.tostring(item.data, encoding=unicode))
|
||||
content = self.remove_newlines(content)
|
||||
content = etree.fromstring(content)
|
||||
|
Loading…
x
Reference in New Issue
Block a user