]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ViewDiff.pm
viewdiff: do not anchor spaces after filenames in diffstat
[public-inbox.git] / lib / PublicInbox / ViewDiff.pm
index 4669e8746f043ac7ca840f5e699cbb478a85a4ac..4d72eb4807199c272c32f133fbcbfb38e982648a 100644 (file)
@@ -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 .= " <a\nid=i$attr\nhref=#$attr>" .
-                       ascii_html($orig) . '</a>'.
+                       ascii_html($orig) . '</a>' . $spaces .
                        to_html($linkify, $rest);
                return 1;
        }