use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use HTML::Parser;
sub import { #{{{
- IkiWiki::hook(type => "preprocess", id => "toc",
- call => \&preprocess);
- IkiWiki::hook(type => "format", id => "toc",
- call => \&format);
+ hook(type => "preprocess", id => "toc", call => \&preprocess);
+ hook(type => "format", id => "toc", call => \&format);
} # }}}
my %tocpages;
if ($tagname =~ /^h(\d+)$/i) {
my $level=$1;
my $anchor="index".++$anchors{$level}."h$level";
- $page.="$text<a name=\"$anchor\" />";
+ $page.="$text<a name=\"$anchor\"></a>";
# Take the first header level seen as the topmost level,
# even if there are higher levels seen later on.