Browse Source

add comment about why not to use fragment_fromstring..

main
John-Mark Gurney 3 years ago
parent
commit
4fef82fac6
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      encthenet_plugins.py

+ 5
- 0
encthenet_plugins.py View File

@@ -12,6 +12,11 @@ def rellinktoabs(context, value):
rel_path = context['resource'].relative_path rel_path = context['resource'].relative_path
content_url = env.globals['content_url'](context, rel_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) html = etree.HTML(value)


# get all the fragment urls # get all the fragment urls


Loading…
Cancel
Save