mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-06 22:53:27 +01:00
...
This commit is contained in:
parent
79d31555b2
commit
72ced811c8
2 changed files with 2 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ def dump_text(self, elem, stylizer, tag_stack=[]):
|
|||
if not isinstance(elem.tag, basestring) \
|
||||
or namespace(elem.tag) != XHTML_NS:
|
||||
p = elem.getparent()
|
||||
if isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \
|
||||
if p is not None and isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \
|
||||
and elem.tail:
|
||||
return elem.tail
|
||||
return u''
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ def dump_text(self, elem, stylizer, end=''):
|
|||
if not isinstance(elem.tag, basestring) \
|
||||
or namespace(elem.tag) != XHTML_NS:
|
||||
p = elem.getparent()
|
||||
if isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \
|
||||
if p is not None and isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \
|
||||
and elem.tail:
|
||||
return [elem.tail]
|
||||
return ['']
|
||||
|
|
|
|||
Loading…
Reference in a new issue