Created
January 31, 2020 06:13
-
-
Save DragorWW/4293222ca2449a4377315416eabd15c9 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
function textNodesUnder(el){ | |
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false); | |
while(n=walk.nextNode()) a.push(n); | |
return a; | |
} | |
function removeText(text) { | |
return 'ауоыиэяюёе'.split('').reduce((acc, i) => acc.replace(RegExp(i,'gi'), ''),text) | |
} | |
textNodesUnder(document.body).forEach(i => i.replaceWith(removeText(i.wholeText))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment