From 9c6dbb636ae2738c4b5d5b96752b7433be0d7b62 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 4 Jan 2020 09:16:21 +0000 Subject: viewdiff: do not anchor spaces after filenames in diffstat Viewing a CSS-less page in a browser which underlines links can show a long line of underscores after diffstats. Not all browsers underline links by default, though. --- lib/PublicInbox/ViewDiff.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index 4669e874..4d72eb48 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -104,8 +104,9 @@ sub anchor0 ($$$$$) { if (my $attr = to_attr($ctx->{-apfx}.$fn)) { $ctx->{-anchors}->{$attr} = 1; + my $spaces = ($orig =~ s/( +)\z//) ? $1 : ''; $$dst .= " " . - ascii_html($orig) . ''. + ascii_html($orig) . '' . $spaces . to_html($linkify, $rest); return 1; } -- cgit v1.2.3-24-ge0c7