title: Best way to modify html before binding to it in AngularJS directive
body: <p>I'm writing an AngularJS app that gets a list of posts from a server, and then uses an ngRepeat and a custom post directive to output all the posts.</p>
  
  <p>Part of the post object is a blob of html, which I currently add to the directive by first doing an $sce.trustAsHtml(blob), and then using the ng-bind-html directive and passing the trusted html blob to it. It works fine, but now I want to modify the html before adding it to the output. For instance, I want to find all link tags and add a target="_blank" to it. I also want to remove any content editable attributes from any element. etc.</p>
  
  <p>What is the best way of doing this? I was thinking of just loading it up in a document fragment and then recursively iterating through all of the children doing what I need to do. But I assume there is a better AngularJS way to do this?</p>
  
  <p>EDIT:</p>
  
  <p>here is a codepen with an example of what I have:
  <a href="http://codepen.io/niltz/pen/neqlC?editors=101" rel="nofollow">http://codepen.io/niltz/pen/neqlC?editors=101</a></p>