diff options
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-x | doc/genps.pl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/genps.pl b/doc/genps.pl index a741be9..14db4d7 100755 --- a/doc/genps.pl +++ b/doc/genps.pl @@ -509,6 +509,22 @@ sub ps_dup_para(@) { } # +# This generates a duplicate of a paragraph, stripping anchor +# tags (-4 and -5) +# +sub ps_dup_para_noanchor(@) { + my(@i) = @_; + my(@o) = (); + my($c); + + foreach $c ( @i ) { + my @cc = @{$c}; + push(@o, [@cc]) unless ( $cc[0] == -4 || $cc[0] == -5 ); + } + return @o; +} + +# # Scan for header paragraphs and fix up their contents; # also generate table of contents and PDF bookmarks. # @@ -535,7 +551,7 @@ for ( $i = 0 ; $i < $npara ; $i++ ) { push(@bookmarks, $book); $bookref{$secn} = $book; - push(@tocparas, [ps_dup_para(@{$paras[$i]})]); + push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]); push(@tocptypes, 'toc0'.' :'.$sech.':'.$chap.' '.$secn.':'); unshift(@{$paras[$i]}, @@ -555,7 +571,7 @@ for ( $i = 0 ; $i < $npara ; $i++ ) { $bookref{$secn} = $book; $bookref{$pref}->[1]--; # Adjust count for parent node - push(@tocparas, [ps_dup_para(@{$paras[$i]})]); + push(@tocparas, [ps_dup_para_noanchor(@{$paras[$i]})]); push(@tocptypes, (($ptype eq 'subh') ? 'toc2':'toc1').' :'.$sech.':'.$secn); |