EPUB Output: When splitting be a little cleverer about discarding 'empty' pages

This commit is contained in:
Kovid Goyal 2011-09-10 09:25:21 -06:00
parent 181d0065b6
commit 694290a166

View File

@ -346,9 +346,9 @@ class FlowSplitter(object):
body = self.get_body(root)
if body is None:
return False
txt = re.sub(r'\s+', '',
txt = re.sub(ur'\s+|\xa0', '',
etree.tostring(body, method='text', encoding=unicode))
if len(txt) > 4:
if len(txt) > 1:
return False
for img in root.xpath('//h:img', namespaces=NAMESPACES):
if img.get('style', '') != 'display:none':