From b5f1010d8a21e87c90f25f0bbd122a34e53c699b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 5 Aug 2013 13:23:56 +0530 Subject: [PATCH] Conversion: Fix removal of empty inline tags Conversion: Fix empty inline tags that are the second child of a paragraph causing text change location. Fixes #1207735 [Conversion issue from epub to mobi. Italicized word sometimes moves to end of paragrah.](https://bugs.launchpad.net/calibre/+bug/1207735) --- src/calibre/ebooks/oeb/parse_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/parse_utils.py b/src/calibre/ebooks/oeb/parse_utils.py index 8bf9c23d98..dd4ee11cc6 100644 --- a/src/calibre/ebooks/oeb/parse_utils.py +++ b/src/calibre/ebooks/oeb/parse_utils.py @@ -399,7 +399,7 @@ def parse_html(data, log=None, decoder=None, preprocessor=None, idx = p.index(a) -1 p.remove(a) if a.tail: - if idx <= 0: + if idx < 0: if p.text is None: p.text = '' p.text += a.tail