join(' ',
'with prefix',
map {"-$_-"}
- ($caniuse->{agents}->{$_[0]}->{prefix_exceptions} // {})->{$_[1]}
+ $caniuse->{agents}->{$_[0]}->{version_list}->{$_[1]}->{prefix}
// $caniuse->{agents}->{$_[0]}->{prefix} // (),
);
},
);
my %versions;
while (my ($browser, $row) = each %{ $caniuse->{agents} }) {
- $versions{$browser} = [
- sort { paddedver($a) cmp paddedver($b) } grep { defined }
- @{ $row->{versions} }
- ];
+ $versions{$browser} = [@{ $row->{versions} }];
}
my $ref = showlink('Can I use', 'https://caniuse.com/');
sprintf('%.1f%%', sum(@{ $canihas->{$browser} }{ @{$span} }) * $usagepct),
'version ' . showversions(@{$span}, undef),
(map {
- $_ ? () : '(development)'
+ $_ ? sprintf('(released %d)', $_/3600/24/365.25 + 1970) : '(development)'
} $caniuse->{agents}->{$browser}->{version_list}->{$lastver}->{release_date}),
),
!defined $lastver && ' class="ex"',
s/(?<= [^.\n]) $/./gmx; # consistently end each line by a period
Entity($_);
s{ ` ([^`]*) ` }{<code>$1</code>}gx;
+ s{ \(\K (?: \Qhttps://caniuse.com\E )? (?: /? \#feat= | / ) }{#}gx;
s{ \[ ([^]]*) \] \( ([^)]*) \) }{<a href="$2">$1</a>}gx;
}
return @html;
# normalised version number comparable as string (cmp)
$_[0] =~ m/(?:.*-|^)(\d*)(.*)/;
# matched (major)(.minor) of last value in range (a-B)
- return sprintf('%02d', length $1 ? $1 : 99) . $2;
+ return sprintf('%03d', length $1 ? $1 : 999) . $2;
}
sub showversions {