]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Hyperlink multiple git hashes on the same commit message line
[Gitweb] / gitweb.perl
index 09f11352491c69a3861cb74fe7975ca4c25241198ebe0964d2817b5087f36e59..b1c9cdf832f0b63b75f5a5f5301cd68a4d45f4458d05fa88738da6724f6aed63 100755 (executable)
@@ -1385,13 +1385,11 @@ sub format_log_line_html {
        my $line = shift;
 
        $line = esc_html($line, -nbsp=>1);
-       if ($line =~ m/\b([0-9a-fA-F]{8,40})\b/) {
-               my $hash_text = $1;
-               my $link =
-                       $cgi->a({-href => href(action=>"object", hash=>$hash_text),
-                               -class => "text"}, $hash_text);
-               $line =~ s/$hash_text/$link/;
-       }
+       $line =~ s{\b([0-9a-fA-F]{8,40})\b}{
+               $cgi->a({-href => href(action=>"object", hash=>$1),
+                                       -class => "text"}, $1);
+       }eg;
+
        return $line;
 }
 
This page took 0.229092 seconds and 4 git commands to generate.