From dd24e82a28a776f833ec6dfd667854907a9231b2 Mon Sep 17 00:00:00 2001 From: Andy Roberts Date: Wed, 11 Feb 2015 18:59:48 +0000 Subject: [PATCH] Append original head children (except title) --- ebooklib/epub.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ebooklib/epub.py b/ebooklib/epub.py index bb8ea94..029c292 100644 --- a/ebooklib/epub.py +++ b/ebooklib/epub.py @@ -262,13 +262,12 @@ def get_content(self, default=None): else: _lnk = etree.SubElement(_head, 'link', lnk) - # this should not be like this - # head = html_root.find('head') - # if head is not None: - # for i in head.getchildren(): - # if i.tag == 'title' and self.title != '': - # continue - # _head.append(i) + head = html_root.find('head') + if head is not None: + for i in head.getchildren(): + if i.tag == 'title' and self.title != '': + continue + _head.append(i) # create and populate body