about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/ViewDiff.pm3
1 files changed, 2 insertions, 1 deletions
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 .= " <a\nid=i$attr\nhref=#$attr>" .
-                        ascii_html($orig) . '</a>'.
+                        ascii_html($orig) . '</a>' . $spaces .
                         to_html($linkify, $rest);
                 return 1;
         }