If you need to remove line breaks from text with JavaScript you can use next string method:
The replace() method searches for a match between a substring (or regular expression) and a string, and replaces the matched substring with a new substring.
Line breaks in text are generally represented as: