From 2faa5a9de6d10bb655d59312257777b74258afd7 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Tue, 22 Jul 2008 21:19:59 +0200 Subject: [PATCH] texi2html: Fix the parent detection of the TOC for unnumbered sections Instead of using the section number I'm now using the ID of the sections to properly detect parents of the current page even if we only have @unnumbered sections (as compared to @chapter). This fixes the snippets page. --- lilypond-texi2html.init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index 2388c5cdb9..e2d69c7390 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -583,7 +583,7 @@ sub generate_ly_toc_entries($$$$) return() if (not defined($element) or exists($element->{'index_page'})); my @result = (); my $level = $element->{'toc_level'}; - my $is_parent_of_current = $element->{'number'} && $element_path->{$element->{'number'}}; + my $is_parent_of_current = $element->{'id'} && $element_path->{$element->{'id'}}; my $print_children = ( ($level < $maxlevel) or $is_parent_of_current ); my $ind = ' ' x $level; my $this_css_class = $is_parent_of_current ? " class=\"toc_current\"" : ""; @@ -622,13 +622,13 @@ sub lilypond_generate_page_toc_body($) my $element = shift; my $current_element = $element; my %parentelements; - $parentelements{$element->{'number'}} = 1; + $parentelements{$element->{'id'}} = 1; # Find the path to the current element while ( defined($current_element->{'sectionup'}) and ($current_element->{'sectionup'} ne $current_element) ) { - $parentelements{$current_element->{'sectionup'}->{'number'}} = 1 - if ($current_element->{'sectionup'}->{'number'} ne ''); + $parentelements{$current_element->{'sectionup'}->{'id'}} = 1 + if ($current_element->{'sectionup'}->{'id'} ne ''); $current_element = $current_element->{'sectionup'}; } return () if not defined($current_element); -- 2.39.5