summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/tools/node2label.pl19
1 files changed, 15 insertions, 4 deletions
diff --git a/Doc/tools/node2label.pl b/Doc/tools/node2label.pl
index 3e4f8f0..5cc54d6 100755
--- a/Doc/tools/node2label.pl
+++ b/Doc/tools/node2label.pl
@@ -15,22 +15,33 @@ foreach $label (sort keys %external_labels) {
$nodes{$key} = $label;
}
+# This adds the "internal" labels added for indexing. These labels will not
+# be used for file names.
+require "intlabels.pl";
+foreach $label (keys %internal_labels) {
+ $key = $internal_labels{$label};
+ $key =~ s|^/||;
+ if (defined($nodes{$key})) {
+ $nodes{$label} = $nodes{$key};
+ }
+}
+
# collect labels that have been used
%newnames = ();
while (<>) {
# don't want to do one s/// per line per node
# so look for lines with hrefs, then do s/// on nodes present
- if (/HREF=\"([^\#\"]*)html[\#\"]/) {
- @parts = split(/HREF\=\"/);
+ if (/(HREF|href)=\"([^\#\"]*)html[\#\"]/) {
+ @parts = split(/(HREF|href)\=\"/);
shift @parts;
for $node (@parts) {
$node =~ s/[\#\"].*$//g;
chop($node);
if (defined($nodes{$node})) {
$label = $nodes{$node};
- if (s/HREF=\"$node([\#\"])/HREF=\"$label.html$1/g) {
- s/HREF=\"$label.html#SECTION\d+/HREF=\"$label.html/g;
+ if (s/(HREF|href)=\"$node([\#\"])/$1=\"$label.html$2/g) {
+ s/(HREF|href)=\"$label.html#(l2h-)?SECTION\d+/$1=\"$label.html/g;
$newnames{$node} = "$label.html";
}
}