Skip to content

Instantly share code, notes, and snippets.

@Schniz
Created April 21, 2021 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Schniz/b61b31dc81dfcd60113959a327c69669 to your computer and use it in GitHub Desktop.
Save Schniz/b61b31dc81dfcd60113959a327c69669 to your computer and use it in GitHub Desktop.
Censor carbon.now.sh exported SVG
function textNodesUnder(el){
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
while(n=walk.nextNode()) a.push(n);
return a;
}
for (let node of textNodesUnder(document.documentElement)) {
node.nodeValue = node.nodeValue.replace(/[^\s]/g, '█');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment