JQuery Tweetify Text - CSS-Tricks

Anonim

Funcţie

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

Utilizare

$("p").tweetify();

Inainte de


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

După


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