From 322382096c1b88abc1a03167c184cd7ab335ab37 Mon Sep 17 00:00:00 2001 From: Constantin Hong Date: Wed, 11 Sep 2024 02:50:59 +0900 Subject: [PATCH] Reapply "html_tools/docs: Fix old comment" This reverts commit 361987796e8e98729be6e39eb88b406a91b14cee. --- changedetectionio/html_tools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/changedetectionio/html_tools.py b/changedetectionio/html_tools.py index 990e0af1..6bbe2236 100644 --- a/changedetectionio/html_tools.py +++ b/changedetectionio/html_tools.py @@ -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