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)
This commit is contained in:
Kovid Goyal 2013-08-05 13:23:56 +05:30
parent 6c630b280f
commit b5f1010d8a

View File

@ -399,7 +399,7 @@ def parse_html(data, log=None, decoder=None, preprocessor=None,
idx = p.index(a) -1 idx = p.index(a) -1
p.remove(a) p.remove(a)
if a.tail: if a.tail:
if idx <= 0: if idx < 0:
if p.text is None: if p.text is None:
p.text = '' p.text = ''
p.text += a.tail p.text += a.tail