Skip to content

Instantly share code, notes, and snippets.

@bcjordan
Created October 3, 2016 18:26
Show Gist options
  • Save bcjordan/78bab1aa5ea879c2525e482456c9abbf to your computer and use it in GitHub Desktop.
Save bcjordan/78bab1aa5ea879c2525e482456c9abbf to your computer and use it in GitHub Desktop.
// ==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