mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
2 lines
577 B
JavaScript
2 lines
577 B
JavaScript
//https://github.com/bryanwoods/autolink-js
|
|
(function(){var a,b=[].slice;a=function(){var j,i,d,f,e,c,g,h;c=1<=arguments.length?b.call(arguments,0):[];g=/(^|\s)(\b(https?):\/\/[\-A-Z0-9+&@#\/%?=~_|!:,.;]*[\-A-Z0-9+&@#\/%=~_|]\b)/ig;if(c.length>0){e=c[0];i=e.callback;if((i!=null)&&typeof i==="function"){j=i;delete e.callback}f="";for(d in e){h=e[d];f+=" "+d+"='"+h+"'"}return this.replace(g,function(l,o,k){var n,m;m=j&&j(k);n=m||("<a href='"+k+"'"+f+">"+k+"</a>");return""+o+n})}else{return this.replace(g,"$1<a href='$2'>$2</a>")}};String.prototype.autoLink=a}).call(this);
|