X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/fc0efae244f2c4bf8063f5962138c2469dc44e6e..86d6ea4639d96053e433344870a307e9e4a225dd:/browser.plp diff --git a/browser.plp b/browser.plp index 375f300..652f6a9 100644 --- a/browser.plp +++ b/browser.plp @@ -58,7 +58,9 @@ my %DSTATS = ( x => sub { join(' ', 'requires prefix', - (map "-$_-", $caniuse->{agents}->{$_[0]}->{prefix} // ()), + map {"-$_-"} + ($caniuse->{agents}->{$_[0]}->{prefix_exceptions} // {})->{$_[1]} + // $caniuse->{agents}->{$_[0]}->{prefix} // (), ); }, ); @@ -270,6 +272,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+//; $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$status}; } } @@ -297,6 +300,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($_); @@ -386,7 +390,7 @@ sub saybrowsercols { # prepare version hover details my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(', ', - map { ref $_ eq 'CODE' ? $_->($browser) : $_ } + map { ref $_ eq 'CODE' ? $_->($browser, $span[0]->[0]) : $_ } map { $DSTATS{$_} // () } map { split / /, $_ } $prev