3 my $textinc = 'sample.txt';
6 title => "unicode sampler",
12 open my $source, '<', $textinc
13 or Abort("Could not open text at $textinc", 501, $!);
16 my $top = readline $source;
17 my ($title, $hr, $intro) = split /\n(\pP)\1+\n/, $top, 2;
18 say "<h1>$title</h1>";
20 <p>HTML display of <a href="/$textinc">plain text</a>
21 intended for monospaced (terminal) output.
22 Compare an expected rendering of the <a href="/sample.png">overview</a>.
29 while (my $p = readline $source) {
31 $p =~ s{ \A ((\pL+) \N*:) \n }{<h2 id="\L$2\E">$1</h2>}x;
32 if ($2 eq 'Unicode') {
33 # table without proper direction control
34 $p =~ s/^(?= )/\x{202d}/gm; # ltr override every line
36 $p =~ s{(?<=^ )([\p{Latin} ]+:)}{<em>$1</em>}gm;