git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
charset: browser compatibility for mobile legends
[sheet.git]
/
sample.plp
diff --git
a/sample.plp
b/sample.plp
index f824e1458e39e4f24356267692f28ac8900090ff..12460ec14e7db44624436747056a16bb6b4bc697 100644
(file)
--- a/
sample.plp
+++ b/
sample.plp
@@
-1,12
+1,15
@@
<(common.inc.plp)><:
<(common.inc.plp)><:
-my $textinc = 'data/unicode-sampler/unicode.txt';
+my $textinc = 'sample.txt';
+my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');
+my $preview = "$proto$ENV{HTTP_HOST}/sample.png";
Html({
title => "unicode sampler",
Html({
title => "unicode sampler",
- version => '2.
0
',
+ version => '2.
1
',
stylesheet => [qw'light dark mono red'],
data => [$textinc],
stylesheet => [qw'light dark mono red'],
data => [$textinc],
+ raw => qq(<meta property="og:image" content="$preview" />),
});
open my $source, '<', $textinc
});
open my $source, '<', $textinc
@@
-14,15
+17,26
@@
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>";
+say <<".";
+<p>HTML display of <a href="/$textinc">plain text</a>
+intended for monospaced (terminal) output.
+Compare an expected rendering of the <a href="/sample.png">overview</a>.
+</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 (\N+:) \n\Z }{<h2>$1</h2>}x;
+ $p =~ s{ \A ((\pL+) \N*:) \n }{<h2 id="\L$2\E">$1</h2>}x;
+ if ($2 eq 'Unicode') {
+ # table without proper direction control
+ $p =~ s/^(?= )/\x{202d}/gm; # ltr override every line
+ }
+ $p =~ s{(?<=^ )([\p{Latin} ]+:)}{<em>$1</em>}gm;
print $p;
}
print $p;
}