sample: reference chapter titles by first word
[sheet.git] / sample.plp
index f824e1458e39e4f24356267692f28ac8900090ff..be68403b48ce1e3bbfdccc96488d60434c3f1bf5 100644 (file)
@@ -22,7 +22,7 @@ print $intro;
 
 while (my $p = readline $source) {
        EscapeHTML($p);
-       $p =~ s{ \A (\N+:) \n\Z }{<h2>$1</h2>}x;
+       $p =~ s{ \A ((\pL+) \N*:) \n\Z }{<h2 id="\L$2\E">$1</h2>}x;
        print $p;
 }