From: Mischa POSLAWSKY Date: Fri, 27 Oct 2023 18:22:45 +0000 (+0200) Subject: sample: html preface and additional (sub)title markup X-Git-Tag: v1.15~33 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/7db73ab9c0171b7c9afd02e205d09b83ce1a2b64 sample: html preface and additional (sub)title markup --- diff --git a/sample.plp b/sample.plp index be68403..b4d2c44 100644 --- a/sample.plp +++ b/sample.plp @@ -14,15 +14,18 @@ open my $source, '<', $textinc local $/ = "\n\n"; my $top = readline $source; -my ($title, $hr, $intro) = split /\n(\H)$1+\n/, $top, 2; +my ($title, $hr, $intro) = split /\n(\pP)\1+\n/, $top, 2; say "

$title

"; +printf '

HTML display of plain text', $textinc; +say ' intended for monospaced (terminal) output.

'; say '
';
 print $intro;
 
 while (my $p = readline $source) {
 	EscapeHTML($p);
-	$p =~ s{ \A ((\pL+) \N*:) \n\Z }{

$1

}x; + $p =~ s{ \A ((\pL+) \N*:) \n }{

$1

}x; + $p =~ s{(?<=^ )([\p{Latin} ]+:)}{$1}gm; print $p; }