Reapply "html_tools/docs: Fix old comment"

This reverts commit 361987796e.
pull/2351/head
Constantin Hong 4 months ago
parent 0a0f281d80
commit 322382096c

@ -114,11 +114,12 @@ def elementpath_tostring(obj):
def forest_transplanting(root):
"""
The html parser of libxml2 violates DOM rules. It means there can be multiple root element
nodes. So I choose just transplating them to a new root by default.
See also, https://gitlab.gnome.org/GNOME/libxml2/-/issues/716
This will emulate xpath1 of html of libxml2 like '/html[2]/*'.
To make this function work, 'fragment=True' in elementpath.select is required.
The html parser of libxml2 violates DOM rules. It means there can be
multiple root element nodes. So I choose just transplating them to a new
root when the violation happens. See also,
https://gitlab.gnome.org/GNOME/libxml2/-/issues/716 This will emulate
xpath1 of html of libxml2 like '/html[2]/*'. To make this function work,
'fragment=True' in elementpath.select is required.
"""
from lxml import etree

Loading…
Cancel
Save