From fc7ae6e36f796f5832f35055308015311340ce9a Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Mon, 17 May 2010 02:41:46 +0200 Subject: [PATCH] Doc-build: fix targets and anchors for xrefs. --- Documentation/lilypond-texi2html.init | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/lilypond-texi2html.init b/Documentation/lilypond-texi2html.init index 3438478..02aefa6 100644 --- a/Documentation/lilypond-texi2html.init +++ b/Documentation/lilypond-texi2html.init @@ -657,10 +657,13 @@ sub lc_last($) { my $href = shift; my @hrefsplit = split('/', $href); - # change the last portion (the filename), if it exists + # change the last portion (the filename), if it exists; + # if it is a plain filename with no path, change the string as a whole if ($#hrefsplit > 0) { @hrefsplit[$#hrefsplit] = lc( @hrefsplit[$#hrefsplit] ); $href = join("/", @hrefsplit); + } else { + $href = lc($href); } return $href; } @@ -934,9 +937,9 @@ sub lilypond_element_target_name($$$) if ($target eq lc_last($id)) { $id = ""; } else { - $id = substr($id, 0, - 2); # remove the "-1" + $id =~ s/-1$//i; # remove any trailing "-1" } - return ($id, $target); + return ($target, $target); } @@ -1107,7 +1110,7 @@ sub lilypond_external_href($$$) sub remove_unneeded_anchor($) { - my $ref = shift; + my $href = shift; my @hrefsplit = split("/", $href); for ($i = 0; $i < @hrefsplit; $i++) { $item = @hrefsplit[$i]; -- 1.7.0.4