Created
January 15, 2014 15:28
-
-
Save firstclown/8438263 to your computer and use it in GitHub Desktop.
Convert plain text in message variable to properly formatted HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message.replace(/\n([ \t]*\n)+/g, '</p><p>').replace(/\n/g, '<br />'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment