From: Sebastin Santy Date: Wed, 15 Mar 2017 20:19:05 +0000 (-0400) Subject: Bug 1309112 - Detect and linkify GitHub issue in comment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7dacb94bd6fd26f80b1a7932a043a3d2219be79;p=thirdparty%2Fbugzilla.git Bug 1309112 - Detect and linkify GitHub issue in comment --- diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 8412a2518..1640bd076 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -720,6 +720,18 @@ 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/, + 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# $owner/$repo\#$number#; + } + }); + # Update certain links to git.mozilla.org to go to github.com instead # https://git.mozilla.org/?p=webtools/bmo/bugzilla.git;a=blob;f=Bugzilla/WebService/Bug.pm;h=d7a1d8f9bb5fdee524f2bb342a4573a63d890f2e;hb=HEAD#l657 push(@$regexes, {