reading Js replaces all line breaks January 21, 2024 by Natalie Gonzalez No Comments Function TransferString(content){let string = content try{string = string.replace(/\r\n/g,'<br>') string = string.replace(/\n/g,"<br>") }catch(e){ console.log(e,"error") } return string; }Copy the code