twitterAutoLinks: jQuery extension to replace twitter @names for links to their respective pages.

Save the following on a .js file, preferably named jquery.twitterAutoLinks.js [javascript] /** Auto replace all Twitter nicknames for links */ $.fn.twitterAutoLinks = function() { return this.each(function() { var html = $(this).html(); $(this).html(html.replace(/B@([w-]+)/gm, ‘<a href="http://twitter.com/$1" target="_blank">@$1</a>’)); }); }; [/javascript] Usage After importing the jquery.twitterAutoLinks.js file (make sure it’s after you’ve imported jquery itself), you’ll use the […]