diff options
author | Mats Wichmann <mats@linux.com> | 2020-04-10 18:24:03 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-04-10 18:24:03 (GMT) |
commit | a4c2ee46188f8b43a451af01eda8b3cfefb1b663 (patch) | |
tree | 87cbfc8ea5ceef70ef56d03214e8e455522bd9ce /bin/scons-proc.py | |
parent | bc94c4e8179b992a2449e06bb6b9a82508f9f6b8 (diff) | |
download | SCons-a4c2ee46188f8b43a451af01eda8b3cfefb1b663.zip SCons-a4c2ee46188f8b43a451af01eda8b3cfefb1b663.tar.gz SCons-a4c2ee46188f8b43a451af01eda8b3cfefb1b663.tar.bz2 |
Second try at fixing sets/uses Tool doc generation. [ci skip]
Fixes #3580 a different way: generate the link itself into
the tools.gen file, instead of post-processing the broken
entity reference back into a usable form.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'bin/scons-proc.py')
-rw-r--r-- | bin/scons-proc.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py index 6c1f66a..ac52894 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -141,23 +141,31 @@ class SCons_XML(object): added = True stf.appendNode(vl, stf.copyNode(s)) + # Generate the text for sets/uses lists of construction vars. + # This used to include an entity reference which would be replaced + # by the link to the cvar, but with lxml, dumping out the tree + # with tostring() will encode the & introducing the entity, + # breaking it. Instead generate the actual link. (issue #3580) if v.sets: added = True vp = stf.newNode("para") - # if using lxml, the &entity; entries will be encoded, - # effectively breaking them. should fix, - # for now handled post-process in calling script. - s = ['&cv-link-%s;' % x for x in v.sets] - stf.setText(vp, 'Sets: ' + ', '.join(s) + '.') + stf.setText(vp, "Sets: ") + for setv in v.sets: + link = stf.newSubNode(vp, "link", linkend="cv-%s" % setv) + linktgt = stf.newSubNode(link, "varname") + stf.setText(linktgt, "$" + setv) + stf.setTail(link, " ") stf.appendNode(vl, vp) + if v.uses: added = True vp = stf.newNode("para") - # if using lxml, the &entity; entries will be encoded, - # effectively breaking them. should fix, - # for now handled post-process in calling script. - u = ['&cv-link-%s;' % x for x in v.uses] - stf.setText(vp, 'Uses: ' + ', '.join(u) + '.') + stf.setText(vp, "Uses: ") + for use in v.uses: + link = stf.newSubNode(vp, "link", linkend="cv-%s" % use) + linktgt = stf.newSubNode(link, "varname") + stf.setText(linktgt, "$" + use) + stf.setTail(link, " ") stf.appendNode(vl, vp) # Still nothing added to this list item? |