2 # quick HTML heading id adder by Paul Wise
3 package IkiWiki::Plugin::headinganchors;
10 hook(type => "getsetup", id => "headinganchors", call => \&getsetup);
11 hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
28 $str =~ s/[&\?"\'\.,\(\)!]//mig;
29 $str =~ s/[^a-z]/_/mig;
33 sub headinganchors (@) {
35 my $content=$params{content};
36 $content=~s{<h([0-9])>([^>]*)</h([0-9])>}{'<h'.$1.' id="'.text_to_anchor($2).'">'.$2.'</h'.$3.'>'}gie;