description => [
"Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)",
"comparing support and usage share for all popular browser versions.",
description => [
"Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)",
"comparing support and usage share for all popular browser versions.",
- (map "-$_-", $caniuse->{agents}->{$_[0]}->{prefix} // ()),
+ map {"-$_-"}
+ ($caniuse->{agents}->{$_[0]}->{prefix_exceptions} // {})->{$_[1]}
+ // $caniuse->{agents}->{$_[0]}->{prefix} // (),
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,
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,
- printf "<p>Invalid browser usage data request: <em>%s</em>",
- 'identifier must be alphanumeric name or <q>0</q>';
+ Alert([
+ 'Invalid browser usage data request',
+ 'Identifier must be alphanumeric name or <q>0</q>.',
+ ]);
for $canihas->{-site} || $canihas->{-source} || ();
$ref .= " $_" for $canihas->{-date} || ();
print "\nwith $ref browser usage statistics";
for $canihas->{-site} || $canihas->{-source} || ();
$ref .= " $_" for $canihas->{-date} || ();
print "\nwith $ref browser usage statistics";
if ($canihas) {
while (my ($browser, $versions) = each %$row) {
ref $versions eq 'HASH' or next;
if ($canihas) {
while (my ($browser, $versions) = each %$row) {
ref $versions eq 'HASH' or next;
- while (my ($version, $_) = each %$versions) {
- $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$_};
+ while (my ($version, $status) = each %$versions) {
+ $status =~ s/\h\#\d+//g;
+ $rank += ($canihas->{$browser}->{$version} || .001) * $PSTATS{$status};
+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($_);
+ s{ ` ([^`]*) ` }{<code>$1</code>}gx;
+ s{ \[ ([^]]*) \] \( ([^)]*) \) }{<a href="$2">$1</a>}gx;
+ }
+ return @html;
+}
+
- s/\.?$/./, print "<p>$_</p>" for map { ref $_ ? @$_ : $_ || () }
- Entity($row->{description}),
- map { s/\s*\n/\n<br>/g; $_ } $row->{notes};
+ print "<p>$_</p>"
+ for formatnotes($row->{description}, $row->{notes} || ());
+ if (my %notes = %{ $row->{notes_by_num} }) {
+ say '<p>Browser-specific notes:';
+ say "<br>#$_: ", formatnotes($notes{$_}) for sort keys %notes;
+ say '</p>';
+ }
printf 'Resources: %s.', join(', ', map {
printf 'Resources: %s.', join(', ', map {
} @$_) for grep { @$_ } $row->{links} // ();
printf '<br>Parent feature: %s.', join(', ', map {
} @$_) for grep { @$_ } $row->{links} // ();
printf '<br>Parent feature: %s.', join(', ', map {
printf '<td title="%s" class="l %s">%s',
$caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell;
}
printf '<td title="%s" class="l %s">%s',
$caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell;
}
# prepare version hover details
my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(', ',
# prepare version hover details
my $title = sprintf('%.1f%% %s', $usage * $usagepct, join(', ',