Commit 11622e4a authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

support nested lists in index

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