X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/bac74b5934f22cc3d0e971d26fe0275f7f5db7b3..887c3bf51abe9f83b4892c48437a7947ebb7fa5d:/browser.plp diff --git a/browser.plp b/browser.plp index bdde90e..a78e0ec 100644 --- a/browser.plp +++ b/browser.plp @@ -96,16 +96,18 @@ given ($get{usage} // 'wm') { # none } when (!m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) { - printf "

Invalid browser usage data request: %s", - 'identifier must be alphanumeric name or 0'; + Alert([ + 'Invalid browser usage data request', + 'Identifier must be alphanumeric name or 0.', + ]); } $canihas = do "data/browser/usage-$_.inc.pl" or do { - printf "

Browser usage data not found: %s", $@ || $!; + Alert('Browser usage data not found', $@ || $!); break; }; $usage = $_; my $ref = $canihas->{-title} || 'unknown'; - $ref = sprintf '%s', $_, $ref + $ref = showlink($ref, $_) for $canihas->{-site} || $canihas->{-source} || (); $ref .= " $_" for $canihas->{-date} || (); print "\nwith $ref browser usage statistics"; @@ -337,10 +339,10 @@ sub saytitlecol { say '

'; } printf 'Resources: %s.', join(', ', map { - sprintf '%s', EscapeHTML($_->{url}), EscapeHTML($_->{title}) + showlink($_->{title}, $_->{url}) } @$_) for grep { @$_ } $row->{links} // (); printf '
Parent feature: %s.', join(', ', map { - sprintf '%s', EscapeHTML("#$_"), $caniuse->{data}->{$_}->{title} + showlink($caniuse->{data}->{$_}->{title}, "#$_") } $_) for $row->{parent} || (); print ''; } @@ -351,7 +353,7 @@ sub saystatuscol { for ($row->{status}) { my $cell = $_ // '-'; - $cell = sprintf '%s', $_, $cell for $row->{spec} // (); + $cell = showlink($cell, $_) for $row->{spec} // (); printf '%s', $caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell; }