Since
(html) is 0D
(hex), this can be represented as '\u000d'
str = str.replace(/\n/g, '\u000d');
Sharing with you guys an AngularJS filter that replaces \n
with that character thanks to the references in the other answers
app.filter('titleLineBreaker', function () {
return function (str) {
if (!str) {
return str;
}
return str.replace(/\n/g, '\u000d');
};
});
usage