Created
January 3, 2018 12:43
-
-
Save dhoepfl/7b3c132e8f8556732b1ebc66ebdd3c2c to your computer and use it in GitHub Desktop.
Tampermonkey script that removes '*' from kwerfeldein.
This file contains hidden or 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 Closing the Gender*Gap | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Removes '*' and '_' gender gaps to make the text more readable. | |
// @author Daniel Höpfl | |
// @match https://kwerfeldein.de/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var txtWalker = document.createTreeWalker ( | |
document.body, | |
NodeFilter.SHOW_TEXT, | |
{ acceptNode: function (node) { | |
//-- Skip whitespace-only nodes | |
if (node.nodeValue.trim() ) | |
return NodeFilter.FILTER_ACCEPT; | |
return NodeFilter.FILTER_SKIP; | |
} | |
}, | |
false | |
); | |
var txtNode = null; | |
while ((txtNode = txtWalker.nextNode()) != undefined) { | |
var oldTxt = txtNode.nodeValue; | |
oldTxt = oldTxt.replace(/[*_]([a-z]+)/g, '$1'); | |
txtNode.nodeValue = oldTxt; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment