I am trying to use multiple filters as below,
<p><span ng-bind-html="someVar | nl2br | linky"></span></p>
which renders nothing. However, when I change the order of filters as below
<p><span ng-bind-html="someVar | linky | nl2br"></span></p>
linky works, but nl2br fails to convert line breaks to br.
The following implementation can be used for nl2br:
.filter('nl2br', function($sce) {
return function(input) {
return $sce.trustAsHtml( input.replace(/\n/g, '<br>') );
}
}