X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/19420d8dd160ff036401c4d245e54712f5d59b7e..13f64783b1e5ed763a85912e7129d58791de8340:/browser.plp diff --git a/browser.plp b/browser.plp index ad8690f..652f6a9 100644 --- a/browser.plp +++ b/browser.plp @@ -22,7 +22,7 @@ Html({ say "
0'; } $canihas = do "data/browser/usage-$_.inc.pl" or do { - printf "
Browser usage data not found: %s", $! || $@; + printf "
Browser usage data not found: %s", $@ || $!; break; }; $usage = $_; @@ -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