From 9652cdfe2eb16150518e34af33c8858118fe0a09 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Apr 2008 15:13:01 -0400 Subject: 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. --- IkiWiki/Plugin/toc.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin/toc.pm') 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}; -- cgit v1.2.3