From 4fef82fac6322e921b0e2f0efb88e82ce309d090 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Tue, 20 Apr 2021 14:52:30 -0700 Subject: [PATCH] add comment about why not to use fragment_fromstring.. --- encthenet_plugins.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/encthenet_plugins.py b/encthenet_plugins.py index 08b9db2..70b55ea 100644 --- a/encthenet_plugins.py +++ b/encthenet_plugins.py @@ -12,6 +12,11 @@ def rellinktoabs(context, value): rel_path = context['resource'].relative_path content_url = env.globals['content_url'](context, rel_path) + # Note that this could be parsed w/ fragment_fromstring + # (https://lxml.de/3.1/api/private/lxml.html-module.html#fragment_fromstring) + # But is would require using create_parent, and stripping that + # instead, or fragments_fromstring, but iterating over those + # to strings. Not one is a solution to the problem. html = etree.HTML(value) # get all the fragment urls