Skip to content

Instantly share code, notes, and snippets.

@firstclown
Created January 15, 2014 15:28
Show Gist options
  • Save firstclown/8438263 to your computer and use it in GitHub Desktop.
Save firstclown/8438263 to your computer and use it in GitHub Desktop.
Convert plain text in message variable to properly formatted HTML
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