I\'m trying to convert newline characters (\\n
) to html br
\'s.
As per this discussion in the Google Group, here\'s what I\'ve got:
An update to the filter with ng-bind-html currently would be:
myApp.filter('newlines', function () {
return function(text) {
return text.replace(/( )? /g, '<br/>');
}
});
and the noHTML filter is no longer required.
white-space solution is having low browser support: http://caniuse.com/#search=tab-size