Skip to content

Instantly share code, notes, and snippets.

@sokcuri
Created July 16, 2017 04:17
Show Gist options
  • Save sokcuri/e23cf856244658a0d2865cf8f6571432 to your computer and use it in GitHub Desktop.
Save sokcuri/e23cf856244658a0d2865cf8f6571432 to your computer and use it in GitHub Desktop.
(function(deepText){deepText=function(node){let N=[];if(node){node=node.firstChild;while(node!=null){if(node.nodeType==3)N[N.length]=node;else N=N.concat(deepText(node));node=node.nextSibling;} return N;};deepText(document.querySelector('.tt_category li')).forEach(el=>{el.data=el.data.trim()});}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment