Skip to content
Snippets Groups Projects
Commit 11622e4a authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

support nested lists in index

parent 48c1cc8c
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,10 @@ my $doctitle = "";
my $curpage = "";
my $intoc = 0;
while (<FILE>) {
if (!$intoc) {
if (keys(%title2page) == 1 && /^\h*\\list/) {
$intoc = 1;
} elsif (/^\h*\\page\h+(\H+)/) {
if (keys(%title2page) == 1 && /^\h*\\list/) {
$intoc++;
} elsif (!$intoc) {
if (/^\h*\\page\h+(\H+)/) {
$curpage = $1;
} elsif (/^\h*\\title\h+(.+)$/) {
if ($curpage eq "") {
......@@ -26,7 +26,7 @@ while (<FILE>) {
}
} else {
if (/^\h*\\endlist/) {
$intoc = 0;
$intoc--;
} elsif (/^\h*\\o\h+\\l{(.*)}$/) {
push @toc, $1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment