mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
c7f90b9fc7
commit
b715e71fce
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user