JQuery Tweetify szöveg - CSS-trükkök

Anonim

Funkció

$.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); )

Használat

$("p").tweetify();

Előtt


@seanhood have you seen this http://icanhascheezburger.com/ #lol

Után


@seanhood have you seen this http://icanhascheezburger.com/ #lol