From b715e71fceff9cd8b694414f3bd1c7dc48b9f2bc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Dec 2011 23:55:05 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/parse_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/parse_utils.py b/src/calibre/ebooks/oeb/parse_utils.py index e02a4d0e61..af0eb479f0 100644 --- a/src/calibre/ebooks/oeb/parse_utils.py +++ b/src/calibre/ebooks/oeb/parse_utils.py @@ -85,8 +85,7 @@ def html5_parse(data, max_nesting_depth=500): # Check that the asinine HTML 5 algorithm did not result in a tree with # insane nesting depths for x in data.iterdescendants(): - if len(x) == 0: - # Leaf node + if isinstance(x.tag, basestring) and len(x) is 0: # Leaf node depth = node_depth(x) if depth > max_nesting_depth: raise ValueError('html5lib resulted in a tree with nesting'