Last active
May 27, 2016 03:52
-
-
Save The-Quill/a9c83993fe585e4f9fe9059081727629 to your computer and use it in GitHub Desktop.
See sneaky punctuation 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 See sneaky punctuation links | |
// @version 1.2 | |
// @namespace https://gist.github.com/The-Quill/a9c83993fe585e4f9fe9059081727629/raw/3038e3d8028d32c220821e1d7d89b093d140a136/sneaky_links.user.js | |
// @description See sneaky punctuation links | |
// @author Quill | |
// @match *://meta.stackexchange.com/questions/* | |
// @match *://*.stackexchange.com/questions/* | |
// @match *://stackoverflow.com/questions/* | |
// @match *://serverfault.com/questions/* | |
// @match *://superuser.com/questions/* | |
// @match *://askubuntu.com/questions/* | |
// @match *://meta.*.stackexchange.com/questions/* | |
// ==/UserScript== | |
var links = document.querySelectorAll('.post-text a'); | |
Array.from(links).forEach(function(link){ | |
var text = link.textContent.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g, ""); | |
if (text.length <= 1 && isNaN(text)){ | |
link.style.backgroundColor = "red"; | |
link.style.padding = "5px"; | |
link.style.color = "white"; | |
} | |
}); |
Author
The-Quill
commented
May 27, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment