angularjs - angular replace was not working -


a = "it popularised<br> in 1960s with<br> release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.";

a.replace(/\n|\t/g,'&lt;br&gt;'); 

all br tags need replace \n\t not working .

use below code:

var myregex = /<br\s*[\/]?>/gi; alert(a.replace(myregex, "\n\t")); 

this should replace every <br> tag \n\t. see jsfiddle


Comments