Skip to content

Instantly share code, notes, and snippets.

@blackhalt
Created July 19, 2012 07:50
Show Gist options
  • Save blackhalt/3141447 to your computer and use it in GitHub Desktop.
Save blackhalt/3141447 to your computer and use it in GitHub Desktop.
Linkify Bookmarklets vienkāršas teksta saites Padara spiežamas
javascript:(function(){var%20D=document;%20D.body.normalize();%20F(D.body);%20function%20F(n){var%20u,A,M,R,c,x;%20if(n.nodeType==3){%20u=n.data.search(/https?\:\/\/[^\s]*[^.,;'%22>\s\)\]]/);%20if(u>=0)%20{%20M=n.splitText(u);%20R=M.splitText(RegExp.lastMatch.length);%20A=document.createElement(%22A%22);%20A.href=M.data;%20A.appendChild(M);%20R.parentNode.insertBefore(A,R);%20}%20}else%20if(n.tagName!=%22STYLE%22%20&&%20n.tagName!=%22SCRIPT%22%20&&%20n.tagName!=%22A%22)for(c=0;x=n.childNodes[c];++c)F(x);%20}%20})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment