mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix error when merging an empty HTML document or one that contains only text and no tags. Fixes #1535427 [Edit ebook, merge selected text files fail.](https://bugs.launchpad.net/calibre/+bug/1535427)
This commit is contained in:
parent
78fcc5cd6c
commit
15aadb14c4
@ -377,8 +377,9 @@ def merge_html(container, names, master):
|
||||
if not isinstance(first_child, basestring):
|
||||
break
|
||||
if isinstance(first_child, basestring):
|
||||
# Empty document, ignore
|
||||
continue
|
||||
# body contained only text, no tags
|
||||
first_child = body.makeelement(XHTML('p'))
|
||||
first_child.text, children[0] = children[0], first_child
|
||||
|
||||
amap = anchor_map[name]
|
||||
remove_name_attributes(root)
|
||||
|
Loading…
x
Reference in New Issue
Block a user