From d6b82e364881527d37b08fb7613462dba8f7692d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 17 Jan 2012 22:37:44 +0530 Subject: [PATCH] Fix HTML 5 parser choking on comments --- src/calibre/ebooks/oeb/parse_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/parse_utils.py b/src/calibre/ebooks/oeb/parse_utils.py index 712427d457..f0b48afb39 100644 --- a/src/calibre/ebooks/oeb/parse_utils.py +++ b/src/calibre/ebooks/oeb/parse_utils.py @@ -103,7 +103,7 @@ def html5_parse(data, max_nesting_depth=100): xmlns_declaration = '{%s}'%XMLNS_NS non_html5_namespaces = {} seen_namespaces = set() - for elem in tuple(data.iter()): + for elem in tuple(data.iter(tag=etree.Element)): elem.attrib.pop('xmlns', None) namespaces = {} for x in tuple(elem.attrib):