X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/ebc74addf8d5d6e200ecc430e6bd553730e10ff5..01d61f72fed7ac041786ea69d1b080f45a4c49d1:/browser.plp diff --git a/browser.plp b/browser.plp index 48bd6e5..0fc1627 100644 --- a/browser.plp +++ b/browser.plp @@ -6,7 +6,7 @@ no if $] >= 5.018, warnings => 'experimental::smartmatch'; Html({ title => 'browser compatibility cheat sheet', - version => 'v1.2', + version => '1.4', description => [ "Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)", "comparing support and usage share for all popular browser versions.", @@ -69,6 +69,7 @@ my %PSTATS = ( # score percentage a => .5, 'a x' => .5, 'a d' => .1, j => .2, 'p j' => .2, 'n d' => .2, 'n x d' => .2, p => .2, 'p p' => .2, 'p d' => .1, + n => 0, u => 0, ); my %CSTATUS = ( unoff => 'l1', # unofficial @@ -272,6 +273,7 @@ sub featurescore { while (my ($browser, $versions) = each %$row) { ref $versions eq 'HASH' or next; while (my ($version, $status) = each %$versions) { + $status =~ s/\h\#\d+//g; $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$status}; } } @@ -299,6 +301,7 @@ sub featurescore { sub formatnotes { my @html = @_; for (@html) { + s/\r\n?/\n/g; # windows returns s/\h* $//gmx; # trailing whitespace s/(?<= [^.\n]) $/./gmx; # consistently end each line by a period Entity($_); @@ -336,7 +339,7 @@ sub saytitlecol { say '

'; } printf 'Resources: %s.', join(', ', map { - sprintf '%s', EscapeHTML($_->{url}), $_->{title} + sprintf '%s', EscapeHTML($_->{url}), EscapeHTML($_->{title}) } @$_) for grep { @$_ } $row->{links} // (); printf '
Parent feature: %s.', join(', ', map { sprintf '%s', EscapeHTML("#$_"), $caniuse->{data}->{$_}->{title}