summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BMO/Extension.pm')
-rw-r--r--extensions/BMO/Extension.pm12
1 files changed, 12 insertions, 0 deletions
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# <a href="https://github.com/$owner/$repo/issues/$number">$owner/$repo\#$number</a>#;
+ }
+ });
+
# 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, {