I am using the jTwitter plugin to get Twitter feeds. I am using it combined with a function that makes the links in the returned text click-able.
That function looks like this:
function replaceURLWithHTMLLinks(text) {
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
}
Everything works fine, except that the person who is sending the tweets is always trying to make parts of it in bold. And it looks like this <b>Bla</b>. It looks like this on his twitter site and also on my page.
I dont know what he does wrong and I dont care, I am just wondering if I could transform those in actual bold at my site by adding another few lines to the function above?
note the ‘g’ flag that tells the replacement to apply to all of the matches.