common: replace html links by common function
[sheet.git] / browser.plp
index 0d4d4e7c8ed17e7da6e8567f41db20164ac0af84..a78e0ecab8f37c178bfa300ecc6b9a58b7473879 100644 (file)
@@ -107,7 +107,7 @@ given ($get{usage} // 'wm') {
        };
        $usage = $_;
        my $ref = $canihas->{-title} || 'unknown';
-       $ref = sprintf '<a href="%s">%s</a>', $_, $ref
+       $ref = showlink($ref, $_)
                for $canihas->{-site} || $canihas->{-source} || ();
        $ref .= " $_" for $canihas->{-date} || ();
        print "\nwith $ref browser usage statistics";
@@ -339,10 +339,10 @@ sub saytitlecol {
                say '</p>';
        }
        printf 'Resources: %s.', join(', ', map {
-               sprintf '<a href="%s">%s</a>', EscapeHTML($_->{url}), EscapeHTML($_->{title})
+               showlink($_->{title}, $_->{url})
        } @$_) for grep { @$_ } $row->{links} // ();
        printf '<br>Parent feature: %s.', join(', ', map {
-               sprintf '<a href="%s">%s</a>', EscapeHTML("#$_"), $caniuse->{data}->{$_}->{title}
+               showlink($caniuse->{data}->{$_}->{title}, "#$_")
        } $_) for $row->{parent} || ();
        print '</div>';
 }
@@ -353,7 +353,7 @@ sub saystatuscol {
 
        for ($row->{status}) {
                my $cell = $_ // '-';
-               $cell = sprintf '<a href="%s">%s</a>', $_, $cell for $row->{spec} // ();
+               $cell = showlink($cell, $_) for $row->{spec} // ();
                printf '<td title="%s" class="l %s">%s',
                        $caniuse->{statuses}->{$_}, $CSTATUS{$_} // '', $cell;
        }