From: Reinhold Kainhofer Date: Mon, 11 Aug 2008 18:32:45 +0000 (+0200) Subject: texi2html: Fix displayed text for external refs X-Git-Tag: release/2.11.58-1~32^2~64^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1e0e5fb4cd57035ffdd00ee1f306c555b483a61f;p=lilypond.git texi2html: Fix displayed text for external refs --- diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index 0849c041d1..2483e0f201 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -352,9 +352,22 @@ sub lilypond_external_ref($$$$$$) my $href = shift; my $cross_ref = shift; - $file_node =~ s/\(.*\)//; - $file_node = &$anchor('', $href, $file_node) if ($file_node ne ''); - return &$I('%{node_file_href}', { 'node_file_href' => $file_node }); + my $displaytext = ''; + + # 1) if we have a cross ref name, that's the text to be displayed: + # 2) For the top node, use the (printable) name of the manual, unless we + # have an explicit cross ref name + # 3) In all other cases use the section name + if ($cross_ref ne '') { + $displaytext = $cross_ref; + } elsif (($section eq '') or ($displaytext eq 'Top')) { + $displaytext = $book; + } else { + $displaytext = $section; + } + + $displaytext = &$anchor('', $href, $displaytext) if ($displaytext ne ''); + return &$I('%{node_file_href}', { 'node_file_href' => $displaytext }); # Default: format as "see NODE section 'SECTION' in BOOK". We don't want this! # return t2h_default_external_ref($type, $section, $book, $file_node, $href, $cross_ref);