countries: ignore capitalised "The" in geonames data
[sheet.git] / sample.plp
index 6de2b98176ef3d913d78e390407bac5173ae7286..be68403b48ce1e3bbfdccc96488d60434c3f1bf5 100644 (file)
@@ -6,11 +6,11 @@ Html({
        title => "unicode sampler",
        version => '2.0',
        stylesheet => [qw'light dark mono red'],
-       data => $textinc,
+       data => [$textinc],
 });
 
 open my $source, '<', $textinc
-       or die "Could not open text at $textinc: $!\n";
+       or Abort("Could not open text at $textinc", 501, $!);
 local $/ = "\n\n";
 
 my $top = readline $source;
@@ -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;
 }