10 if (m/^-+$/ || m/^=+$/) {
11 my $lev = $& =~ m/^=/ ? ' ' : ' ';
13 $href =~ y/ A-Z/-a-z/;
14 $href =~ y/-._a-z//cd;
16 $text = 'Introduction' if $. == 2;
17 push @toc, "${lev}* [$text](#$href)\n";
23 if (1..(m/^[A-Z]/ && m/table of contents/i)) {
33 print if m/^===|^---/;
38 print <<END, @toc, "\n";
40 <!-- TOC autogenerated by $0, do not edit -->