Created
March 4, 2015 13:29
-
-
Save jiin/3e4a9cd94c601cf51764 to your computer and use it in GitHub Desktop.
nl2br
This file contains hidden or 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
.filter('nl2br', function () { | |
return function (text) { | |
return (text + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2'); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment