I have tweets being generated through the Twitter API, for example:
<article class="tweet">
Some users may have experienced issues accessing http://t.co/zDdcbPNfnU on @Firefox 22+. We've reached out to Mozilla and it's now resolved.
</article>
<article class="tweet">
The issue with viewing photos is now resolved. Thanks for your patience!
</article>
The links aren't generating with the correct markup, so now what I want to do is select any words that begin with http://
and wrap those words in an anchor tag.
I thought I could do something similar to this, but this obviously doesn't work:
$('article.tweet').each(function(){
var linkHref = $(this).html().find('http://');
$(linkHref).wrap('<a href="' + linkHref + '" />');
});
How can I select the links with jQuery?