I currently have:
$('.tweet').text(function (_, text) {
var exp = /(#(\S+))/g;
return text.replace(exp, '<a href="http://twitter.com/#!/search/%23$2">
`$1
</a>'
);
});
This create the essentially something like:
<a href="http://twitter.com/#!/search/%23data">#data </a>
but it still displays as text and not a link.
Image example:

Use
.html()instead of.text().If you use
.text(), your HTML will be escaped:jsFiddle Example with
.html()