diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index efd27ef8f3..3256e1168a 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -285,8 +285,10 @@ class EPUBOutput(OutputFormatPlugin): for elem in root.iterdescendants(): if getattr(elem, 'text', False): elem.text = special_chars.sub('', elem.text) + elem.text = elem.text.replace(u'\u2011', '-') if getattr(elem, 'tail', False): elem.tail = special_chars.sub('', elem.tail) + elem.tail = elem.tail.replace(u'\u2011', '-') diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 5010e9e8e8..ff398ca3bb 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -305,6 +305,15 @@ class MobiReader(object): self.log.warning('Markup contains unclosed
tags, parsing using', 'BeatifulSoup') root = soupparser.fromstring(self.processed_html) + if root[0].tag != 'html': + self.log.warn('File does not have opening tag') + nroot = html.fromstring('
') + bod = nroot.find('body') + for child in list(root): + child.getparent().remove(child) + bod.append(child) + root = nroot + self.upshift_markup(root) guides = root.xpath('//guide') guide = guides[0] if guides else None diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 1407adad58..0c02ef2925 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -218,6 +218,10 @@ If it still wont launch, start a command prompt (press the windows key and R; th Post any output you see in a help message on the `Forum