Fonksiyon
$.fn.tweetify = function() ( this.each(function() ( $(this).html( $(this).html() .replace(/((ftp|http|https):\/\/(\w+:(0,1)\w*@)?(\S+)(:(0-9)+)?(\/|\/((\w#!:.?+=&%@!\-\/)))?)/gi,'$1') .replace(/(^|\s)#(\w+)/g,'$1#$2') .replace(/(^|\s)@(\w+)/g,'$1@$2') ); )); return $(this); )
Kullanım
$("p").tweetify();
Önce
@seanhood have you seen this http://icanhascheezburger.com/ #lol
Sonra
@seanhood have you seen this http://icanhascheezburger.com/ #lol