I receive an HTML entities string from an API (like this "<p> Some text <br />"
) and I would like it to be rendered as HTML.
If I use the classical HTML solution with sanitize :
.filter('html',function($sce){
return function(input){
return $sce.trustAsHtml(input);
}
});
I obtain <p> Some text <br />
as string instead of the <p>
and <br>
being interpreted as HTML.
The only solution I see for now is to realize some replace and to apply the filter after.
Is there a cleaner solution that avoids parsing the string twice?