Created
June 14, 2015 04:46
-
-
Save hoelzro/5c16c12baa9dc951511e to your computer and use it in GitHub Desktop.
Perl 6 RT links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Perl 6 RT links | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js | |
// @description Provide links to rt.perl.org for RT references in commit messages | |
// @include https://github.com/rakudo/* | |
// @include https://github.com/perl6/* | |
// @include https://github.com/MoarVM/* | |
// ==/UserScript== | |
(function($) { | |
$('.commit-desc').each(function(_, element) { | |
var html = $(element).html(); | |
var originalHTML = html; | |
html = html.replace(/RT\s+#(\d+)/, function(match, ticketID) { | |
return "<a href='https://rt.perl.org/Ticket/Display.html?id='" + ticketID + ">" + match + "</a>"; | |
}); | |
if(html !== originalHTML) { | |
$(element).html(html); | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment