javascript preserve line breaks code example
Example 1: Remove line breaks with JavaScript
String.replace(/(\r\n|\n|\r)/gm," ")
Example 2: javascript line break
//in JavaScript, you can declare a line break (or new line)
//with the \n character.
var linebreak = '\n';