diff options
author | Duda Dornelles <dudassdornelles@gmail.com> | 2015-01-09 10:05:38 -0200 |
---|---|---|
committer | Pixpoa pairing <pixpoapairing@pixelated-project.org> | 2015-01-09 10:05:49 -0200 |
commit | 6ed531b7181f179d9c1e1098e93cdca6b610f298 (patch) | |
tree | a3fed01e64f8d81f9cc2db577ae708d16d8ab186 /web-ui/app | |
parent | 0c2740478fbd74c482f18e8fec1ca6ef6c776d85 (diff) |
Small refactoring on web_ui/viewHelper#addParagraphsToPlainText to use regex instad of split/map/join
Diffstat (limited to 'web-ui/app')
-rw-r--r-- | web-ui/app/js/helpers/view_helper.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index 7173d8be..845c1190 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -32,9 +32,7 @@ define( } function addParagraphsToPlainText(textPlainBody) { - return _.map(textPlainBody.split('\n'), function (paragraph) { - return '<p>' + paragraph + '</p>'; - }).join(''); + return textPlainBody.replace(/^(.*?)$/mg, "<p>$1</p>") } function formatMailBody (mail) { |