diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index fad89612c7..74a97bf727 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -352,6 +352,7 @@ class FB2MLizer(object): @return: List of string representing the XHTML converted to FB2 markup. ''' from calibre.ebooks.oeb.base import XHTML_NS, barename, namespace + elem = elem_tree # Ensure what we are converting is not a string and that the fist tag is part of the XHTML namespace. if not isinstance(elem_tree.tag, basestring) or namespace(elem_tree.tag) != XHTML_NS: diff --git a/src/calibre/ebooks/pml/pmlml.py b/src/calibre/ebooks/pml/pmlml.py index 506e18654e..0fec9a0014 100644 --- a/src/calibre/ebooks/pml/pmlml.py +++ b/src/calibre/ebooks/pml/pmlml.py @@ -220,7 +220,7 @@ class PMLMLizer(object): def dump_text(self, elem, stylizer, page, tag_stack=[]): from calibre.ebooks.oeb.base import XHTML_NS, barename, namespace - if not isinstance(elem_tree.tag, basestring) or namespace(elem_tree.tag) != XHTML_NS: + if not isinstance(elem.tag, basestring) or namespace(elem.tag) != XHTML_NS: p = elem.getparent() if p is not None and isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \ and elem.tail: diff --git a/src/calibre/ebooks/rb/rbml.py b/src/calibre/ebooks/rb/rbml.py index c5b110c679..d1b097a235 100644 --- a/src/calibre/ebooks/rb/rbml.py +++ b/src/calibre/ebooks/rb/rbml.py @@ -142,7 +142,7 @@ class RBMLizer(object): def dump_text(self, elem, stylizer, page, tag_stack=[]): from calibre.ebooks.oeb.base import XHTML_NS, barename, namespace - if not isinstance(elem_tree.tag, basestring) or namespace(elem_tree.tag) != XHTML_NS: + if not isinstance(elem.tag, basestring) or namespace(elem.tag) != XHTML_NS: p = elem.getparent() if p is not None and isinstance(p.tag, basestring) and namespace(p.tag) == XHTML_NS \ and elem.tail: