Skip to content

Instantly share code, notes, and snippets.

@bnjm
Created November 12, 2016 15:21
Show Gist options
  • Save bnjm/a69c78cdc45265e18e4fe2da3fea4939 to your computer and use it in GitHub Desktop.
Save bnjm/a69c78cdc45265e18e4fe2da3fea4939 to your computer and use it in GitHub Desktop.
(function(e){
var n
var a = []
var walk = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, null, false)
while (n = walk.nextNode()){
a.push(n)
return a
}
})(document.body).forEach(x => {
x.textContent = x
.textContent
.replace(/donald|trump/gi,'💩')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment