Update html_tools.py to trigger test

just blanks
pull/2351/head
Constantin Hong 4 months ago committed by GitHub
parent 322382096c
commit 93950c0f3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -123,14 +123,14 @@ def forest_transplanting(root):
"""
from lxml import etree
root_siblings_preceding = [ s for s in root.itersiblings(preceding=True)]
root_siblings_preceding = [s for s in root.itersiblings(preceding=True)]
root_siblings = [s for s in root.itersiblings()]
Is_fragment=False
Is_fragment = False
# If element node exsits in root element node's sibilings, it is fragment.
for node in chain(root_siblings_preceding, root_siblings):
if not hasattr(node.tag, '__name__'):
Is_fragment=True
Is_fragment = True
# early exit. because the root is already root element.
# So, two root element nodes are detected. DOM violation.
break

Loading…
Cancel
Save