From 46f51ee9408db3acf72e40d46711cad0215ad119 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Jul 2012 09:06:49 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/fb2/fb2ml.py | 1 + src/calibre/ebooks/pml/pmlml.py | 2 +- src/calibre/ebooks/rb/rbml.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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: