sub saybrowsercols {
my ($id, $browser) = @_;
- my $data = $caniuse->{data}->{$id}->{stats}->{$browser};
+ my $feature = $caniuse->{data}->{$id};
+ my $data = $feature->{stats}->{$browser};
if (ref $data eq 'ARRAY') {
# special case for unsupported
my $release = $caniuse->{agents}->{$browser}->{verrelease};
);
unless (!defined $prev or $prev ~~ $compare) {
my $usage = sum(@{ $canihas->{$browser} }{ map { @{$_} } @span });
- printf '<td class="%s" colspan="%d" title="%s">%s',
+
+ # strip #\d note references from support class
+ my @notes;
+ push @notes, $feature->{notes_by_num}->{$1}
+ while $prev =~ s/\h \# (\d+) \b//x;
+
+ # prepare version hover details
+ my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(', ',
+ map { ref $_ eq 'CODE' ? $_->($browser) : $_ }
+ map { $DSTATS{$_} // () }
+ map { split / /, $_ }
+ $prev
+ ));
+ $title .= "\n".EscapeHTML($_) for @notes;
+
+ printf('<td class="%s" colspan="%d" title="%s">%s',
join(' ',
X => $CSTATS{$prev},
!$usage ? ('p0') : ('p',
sprintf('pp%02d', $usage / $usagemax),
),
scalar @span,
- sprintf('%.1f%% %s', $usage * $usagepct, join(', ',
- map { ref $_ eq 'CODE' ? $_->($browser) : $_ }
- map { $DSTATS{$_} // () }
- map { split / /, $_ }
- $prev
- )),
+ $title,
showversions($span[0]->[0], @span > 1 ? ($span[-1]->[-1]) : ()),
+ );
undef $prev;
@span = ();
}