summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-04-26 15:13:01 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-04-26 15:13:01 -0400
commit9652cdfe2eb16150518e34af33c8858118fe0a09 (patch)
tree245dc76c0809d2c53f6114558c7e3c9b06ddb4e7 /IkiWiki/Plugin
parent2d78c4d9a70f93d97047fa414c8fb5fa693712dd (diff)
toc: Add the table of contents at sanitize time, rather than at format time. This allows the toc to be displayed when previewing an edit. It also avoids headers in the page template from showing up in the toc.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/toc.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/toc.pm b/IkiWiki/Plugin/toc.pm
index 639cae4a9..5380dd965 100644
--- a/IkiWiki/Plugin/toc.pm
+++ b/IkiWiki/Plugin/toc.pm
@@ -9,7 +9,7 @@ use HTML::Parser;
sub import { #{{{
hook(type => "preprocess", id => "toc", call => \&preprocess);
- hook(type => "format", id => "toc", call => \&format);
+ hook(type => "sanitize", id => "toc", call => \&sanitize);
} # }}}
my %tocpages;
@@ -33,7 +33,7 @@ sub preprocess (@) { #{{{
}
} # }}}
-sub format (@) { #{{{
+sub sanitize (@) { #{{{
my %params=@_;
my $content=$params{content};