SyntaxFix
Write A Post
Hire A Developer
Questions
Handles either type of line break
str.replace(new RegExp('\r?\n','g'), '<br />');