X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/f42145cdf77de3602378c70f18545703783122c5..bb06ade4941ab8a981256d06b1d1a36a5564c690:/browser.plp diff --git a/browser.plp b/browser.plp index d3b4596..6d75d4a 100644 --- a/browser.plp +++ b/browser.plp @@ -4,7 +4,7 @@ no if $] >= 5.018, warnings => 'experimental::smartmatch'; Html({ title => 'browser compatibility cheat sheet', - version => '1.5', + version => '1.6', description => [ "Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)", "comparing support and usage share for all popular browser versions.", @@ -20,7 +20,7 @@ Html({ say "
0.', ]); } - $canihas = do "data/browser/usage-$_.inc.pl" or do { - Alert('Browser usage data not found', $@ || $!); + $canihas = eval { Data("data/browser/usage-$_") } or do { + Alert('Browser usage data not found', $@); break; }; $usage = $_; @@ -243,7 +240,7 @@ for my $browser (@browsers) { sprintf('%.1f%%', sum(@{ $canihas->{$browser} }{ @{$span} }) * $usagepct), 'version ' . showversions(@{$span}, undef), (map { - $_ ? () : '(development)' + $_ ? sprintf('(released %d)', $_/3600/24/365.25 + 1970) : '(development)' } $caniuse->{agents}->{$browser}->{version_list}->{$lastver}->{release_date}), ), !defined $lastver && ' class="ex"', @@ -311,6 +308,7 @@ sub formatnotes { s/(?<= [^.\n]) $/./gmx; # consistently end each line by a period Entity($_); s{ ` ([^`]*) ` }{
$1
}gx;
+ s{ \(\K (?: \Qhttps://caniuse.com\E )? (?: /? \#feat= | / ) }{#}gx;
s{ \[ ([^]]*) \] \( ([^)]*) \) }{$1}gx;
}
return @html;
@@ -469,7 +467,7 @@ sub paddedver {
# normalised version number comparable as string (cmp)
$_[0] =~ m/(?:.*-|^)(\d*)(.*)/;
# matched (major)(.minor) of last value in range (a-B)
- return sprintf('%02d', length $1 ? $1 : 99) . $2;
+ return sprintf('%03d', length $1 ? $1 : 999) . $2;
}
sub showversions {