mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix HTML 5 parser choking on comments
This commit is contained in:
parent
1a361f694f
commit
d6b82e3648
@ -103,7 +103,7 @@ def html5_parse(data, max_nesting_depth=100):
|
|||||||
xmlns_declaration = '{%s}'%XMLNS_NS
|
xmlns_declaration = '{%s}'%XMLNS_NS
|
||||||
non_html5_namespaces = {}
|
non_html5_namespaces = {}
|
||||||
seen_namespaces = set()
|
seen_namespaces = set()
|
||||||
for elem in tuple(data.iter()):
|
for elem in tuple(data.iter(tag=etree.Element)):
|
||||||
elem.attrib.pop('xmlns', None)
|
elem.attrib.pop('xmlns', None)
|
||||||
namespaces = {}
|
namespaces = {}
|
||||||
for x in tuple(elem.attrib):
|
for x in tuple(elem.attrib):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user