git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: html page headers on plp errors
[sheet.git]
/
browser.plp
diff --git
a/browser.plp
b/browser.plp
index 0d4d4e7c8ed17e7da6e8567f41db20164ac0af84..de245b8159a8af06e56b140ccfe0dab3d24cbc38 100644
(file)
--- a/
browser.plp
+++ b/
browser.plp
@@
-90,7
+90,7
@@
print <<'';
<p id="intro">Alternate rendition of Fyrd's <a href="http://caniuse.com/">when can I use...</a> page
my ($canihas, $usage);
<p id="intro">Alternate rendition of Fyrd's <a href="http://caniuse.com/">when can I use...</a> page
my ($canihas, $usage);
-my $minusage = $get{threshold} //
.7
;
+my $minusage = $get{threshold} //
1
;
given ($get{usage} // 'wm') {
when (!$_) {
# none
given ($get{usage} // 'wm') {
when (!$_) {
# none
@@
-107,7
+107,7
@@
given ($get{usage} // 'wm') {
};
$usage = $_;
my $ref = $canihas->{-title} || 'unknown';
};
$usage = $_;
my $ref = $canihas->{-title} || 'unknown';
- $ref = s
printf '<a href="%s">%s</a>', $_, $ref
+ $ref = s
howlink($ref, $_)
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";
@@
-311,6
+311,15
@@
sub formatnotes {
return @html;
}
return @html;
}
+sub notestotitle {
+ my @notes = @_;
+ for (@notes) {
+ EscapeHTML($_);
+ s{ \[ ([^]]*) \] \( [^)]* \) }{$1}gx; # strip link urls
+ }
+ return @notes;
+}
+
sub saytitlecol {
my ($id) = @_;
my $row = $caniuse->{data}->{$id};
sub saytitlecol {
my ($id) = @_;
my $row = $caniuse->{data}->{$id};
@@
-339,10
+348,10
@@
sub saytitlecol {
say '</p>';
}
printf 'Resources: %s.', join(', ', map {
say '</p>';
}
printf 'Resources: %s.', join(', ', map {
- s
printf '<a href="%s">%s</a>', EscapeHTML($_->{url}), EscapeHTML($_->{title
})
+ s
howlink($_->{title}, $_->{url
})
} @$_) for grep { @$_ } $row->{links} // ();
printf '<br>Parent feature: %s.', join(', ', map {
} @$_) for grep { @$_ } $row->{links} // ();
printf '<br>Parent feature: %s.', join(', ', map {
- s
printf '<a href="%s">%s</a>', EscapeHTML("#$_"), $caniuse->{data}->{$_}->{title}
+ s
howlink($caniuse->{data}->{$_}->{title}, "#$_")
} $_) for $row->{parent} || ();
print '</div>';
}
} $_) for $row->{parent} || ();
print '</div>';
}
@@
-353,7
+362,7
@@
sub saystatuscol {
for ($row->{status}) {
my $cell = $_ // '-';
for ($row->{status}) {
my $cell = $_ // '-';
- $cell = s
printf '<a href="%s">%s</a>', $_, $cell
for $row->{spec} // ();
+ $cell = s
howlink($cell, $_)
for $row->{spec} // ();
printf '<td title="%s" class="l %s">%s',
$caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell;
}
printf '<td title="%s" class="l %s">%s',
$caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell;
}
@@
-396,7
+405,7
@@
sub saybrowsercols {
map { split / /, $_ }
$prev
));
map { split / /, $_ }
$prev
));
- $title .= "\n
".EscapeHTML($_) for @notes
;
+ $title .= "\n
$_" for notestotitle(@notes)
;
printf('<td class="%s" colspan="%d" title="%s">%s',
join(' ',
printf('<td class="%s" colspan="%d" title="%s">%s',
join(' ',