git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a14ea8
)
sample: html preface and additional (sub)title markup
author
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 27 Oct 2023 18:22:45 +0000
(20:22 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 27 Oct 2023 19:50:16 +0000
(21:50 +0200)
sample.plp
patch
|
blob
|
history
diff --git
a/sample.plp
b/sample.plp
index be68403b48ce1e3bbfdccc96488d60434c3f1bf5..b4d2c44c963b7534351d500b0a54d43f9b8e52e2 100644
(file)
--- a/
sample.plp
+++ b/
sample.plp
@@
-14,15
+14,18
@@
open my $source, '<', $textinc
local $/ = "\n\n";
my $top = readline $source;
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 "<h1>$title</h1>";
say "<h1>$title</h1>";
+printf '<p>HTML display of <a href="%s">plain text</a>', $textinc;
+say ' intended for monospaced (terminal) output.</p>';
say '<pre>';
print $intro;
while (my $p = readline $source) {
EscapeHTML($p);
say '<pre>';
print $intro;
while (my $p = readline $source) {
EscapeHTML($p);
- $p =~ s{ \A ((\pL+) \N*:) \n\Z }{<h2 id="\L$2\E">$1</h2>}x;
+ $p =~ s{ \A ((\pL+) \N*:) \n }{<h2 id="\L$2\E">$1</h2>}x;
+ $p =~ s{(?<=^ )([\p{Latin} ]+:)}{<em>$1</em>}gm;
print $p;
}
print $p;
}