diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index 4d21c33c83..61226ca4f4 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -194,7 +194,7 @@ def clean_edges(self, cssdict, style, fsize): def flatten_node(self, node, stylizer, names, styles, psize, left=0): if not isinstance(node.tag, basestring) \ or namespace(node.tag) != XHTML_NS: - return + return tag = barename(node.tag) style = stylizer.style(node) cssdict = style.cssdict() diff --git a/src/calibre/ebooks/oeb/transforms/split.py b/src/calibre/ebooks/oeb/transforms/split.py index 7c1559fda6..52133c91d9 100644 --- a/src/calibre/ebooks/oeb/transforms/split.py +++ b/src/calibre/ebooks/oeb/transforms/split.py @@ -91,7 +91,6 @@ def find_page_breaks(self, item): False)) except: pass - page_breaks = set([]) for selector, before in self.page_break_selectors: body = item.data.xpath('//h:body', namespaces=NAMESPACES) @@ -382,6 +381,7 @@ def split_to_size(self, tree): p[i:i+1] = new_pres split_point, before = self.find_split_point(root) + self.log.debug('\t\t\tSplit point:', split_point.tag, tree.getpath(split_point)) if split_point is None: raise SplitError(self.item.href, root) @@ -396,6 +396,9 @@ def split_to_size(self, tree): '\t\t\tCommitted sub-tree #%d (%d KB)'%( len(self.split_trees), size/1024.)) else: + self.log.debug( + '\t\t\tSplit tree still too large: %d KB' % \ + (size/1024.)) self.split_to_size(t) def find_split_point(self, root):