Created
October 3, 2016 18:26
-
-
Save bcjordan/78bab1aa5ea879c2525e482456c9abbf to your computer and use it in GitHub Desktop.
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 CircleCI Cucumber link converter. | |
// @namespace https://code.org | |
// @version 0.1 | |
// @description Converts eyes result URLs to links and opens in new tabs. | |
// @match https://circleci.com/gh/code-dot-org/code-dot-org/* | |
// @copyright 2016 | |
// @require http://code.jquery.com/jquery-2.1.1.min.js | |
// ==/UserScript== | |
function urlify(text) { | |
var urlRegex = /(https?:\/\/cucumber[^\s]+)/g; | |
return text.replace(urlRegex, function(url) { | |
return '<a href="' + url + '">' + url + '</a>'; | |
}); | |
} | |
document.doLinks = () => $('body').html(urlify($('body').html())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment