]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1351116 - github issue links are not expanded in parentheses
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 14 Nov 2018 22:47:09 +0000 (17:47 -0500)
committerGitHub <noreply@github.com>
Wed, 14 Nov 2018 22:47:09 +0000 (17:47 -0500)
extensions/BMO/Extension.pm

index 58a1d02f96bf5caa3295af924ca057270f164fde..1914cfb1d6a23da97666303ea8165377c97d640a 100644 (file)
@@ -724,13 +724,13 @@ sub bug_format_comment {
 
     # link github pull requests and issues
     push (@$regexes, {
-        match => qr/(\s)([A-Za-z0-9_\.-]+)\/([A-Za-z0-9_\.-]+)\#([0-9]+)\b/,
+        match => qr/\b([A-Za-z0-9_\.-]+)\/([A-Za-z0-9_\.-]+)\#([0-9]+)\b/,
         replace => sub {
             my $args = shift;
-            my $owner = html_quote($args->{matches}->[1]);
-            my $repo = html_quote($args->{matches}->[2]);
-            my $number = html_quote($args->{matches}->[3]);
-            return qq# <a href="https://github.com/$owner/$repo/issues/$number">$owner/$repo\#$number</a>#;
+            my $owner = html_quote($args->{matches}->[0]);
+            my $repo = html_quote($args->{matches}->[1]);
+            my $number = html_quote($args->{matches}->[2]);
+            return qq#<a href="https://github.com/$owner/$repo/issues/$number">$owner/$repo\#$number</a>#;
         }
     });