Angular: Empty Fiddle
http://angularjs.org/
HTML
<div ng-controller="MyController">
<div ng-bind-html="myHTML | createAnchors"></div>
</div>
JavaScript
var myApp = angular.module('myApp',[]).controller('MyController', function($scope, $sce) {
$scope.myHTML = 'I am an string with http://stackoverflow.com links and other <strong>stuff</strong>';
}).filter('createAnchors', function($sce) {
return function(str) {
var parts = str.split('http://stackoverflow.com');
// return this escaped:
parts[0];
// return this unescaped:
var link = '<a href="http://stackoverflow.com">http://stackoverflow.com</a>';
// return this escaped:
parts[1];
return parts[0] + link + parts[1];
}
});