From 763adac30a2cbbf5fffbb8c0981e6e6ef2b3c36a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 1 Nov 2013 19:22:50 +0100 Subject: don't let unrelated lists in the front page confuse us instead, look for a section named "Table Of Contents". Task-number: QTCREATORBUG-10585 Change-Id: Ieca51b40387749243a633369119a7d9473ee2325 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- doc/fixnavi.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/fixnavi.pl') diff --git a/doc/fixnavi.pl b/doc/fixnavi.pl index 3ce862beb8..710dae03d3 100755 --- a/doc/fixnavi.pl +++ b/doc/fixnavi.pl @@ -51,7 +51,7 @@ my %next_define_skips = (); my %prev_polarity_skips = (); my %next_polarity_skips = (); for my $file (@files) { - my ($curpage, $inhdr, $intoc, $inif) = ("", 0, 0, 0); + my ($curpage, $inhdr, $havetoc, $intoc, $inif) = ("", 0, 0, 0, 0); my ($define_skip, $polarity_skip, $skipping) = ("", 0, 0); my ($prev_define_skip, $prev_polarity_skip, $prev_skip, $next_define_skip, $next_polarity_skip, $next_skip) = ("", 0, "", "", 0, ""); @@ -73,7 +73,9 @@ for my $file (@files) { $inif = 0; $skipping = 0; $define_skip = ""; - } elsif (keys(%title2page) == 1 && /^\h*\\list/) { + } elsif (keys(%title2page) == 1 && /^\h*\\section1 Table Of Contents/) { + $havetoc = 1; + } elsif ($havetoc && /^\h*\\list/) { $intoc++; } elsif ($intoc) { if (/^\h*\\endlist/) { @@ -111,6 +113,7 @@ for my $file (@files) { } } else { if (/^\h*\\contentspage\b/) { + $havetoc = 0; $inhdr = 1; } } -- cgit v1.2.1