From: Vladimír Vondruš Date: Mon, 1 Aug 2022 12:41:00 +0000 (+0200) Subject: m.dox: document a rather nasty abuse of lack of python variable scoping. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=b24e138da7b65c83b15e66137d8ed23cc545e386;p=blog.git m.dox: document a rather nasty abuse of lack of python variable scoping. --- diff --git a/plugins/m/dox.py b/plugins/m/dox.py index 7af7db0a..456d0d11 100644 --- a/plugins/m/dox.py +++ b/plugins/m/dox.py @@ -121,7 +121,10 @@ def init(tagfiles, input): for value in member.findall('enumvalue'): symbol_mapping[enumeration + '::' + value.text] = (None, link + '#' + value.attrib['anchor'], css_classes) - # Sections + # Sections. While rather strange, these reuse the `link` + # variable defined by whatever came earlier --- because pages + # have it with implicit `.html` but e.g. files with explicit + # `.html`. TODO: fix more robustly for section in child.findall('docanchor'): symbol_mapping[section.text] = (section.attrib.get('title', ''), link + '#' + section.text, css_classes)