summaryrefslogtreecommitdiff
path: root/web-ui/app/js/helpers
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2015-02-18 16:41:51 -0200
committerDuda Dornelles <ddornell@thoughtworks.com>2015-02-18 17:04:05 -0200
commit6ef38d4dfe81dcdeda6dd3287587b80ad58e4c6c (patch)
tree09d5f922c094d9f0bed207dc9ab6a0dc62f245d0 /web-ui/app/js/helpers
parentdd63db87fdbb9667c1027edd700b4047b6983d1f (diff)
Using line breaks instead of paragraphs to format text plain mails on the mail view
Diffstat (limited to 'web-ui/app/js/helpers')
-rw-r--r--web-ui/app/js/helpers/view_helper.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js
index 22ab1324..9c9cacfd 100644
--- a/web-ui/app/js/helpers/view_helper.js
+++ b/web-ui/app/js/helpers/view_helper.js
@@ -32,7 +32,7 @@ define(
}
function addParagraphsToPlainText(textPlainBody) {
- return textPlainBody.replace(/^(.*?)$/mg, '<p>$1</p>');
+ return textPlainBody.replace(/^(.*?)$/mg, '$1<br/>');
}
function escapeHtmlTags(body) {
@@ -44,7 +44,6 @@ define(
'"': '&quot;',
'\'':'&#39;',
'/': '&#x2f;'
-
};
return body.replace(/["'<>\/&]/g, function(char){
@@ -62,7 +61,7 @@ define(
var body = mail.htmlBodyPart ?
htmlWhitelister.sanitize(mail.htmlBody, htmlWhitelister.tagPolicy) :
escapeHtmlAndAddParagraphs(mail.textPlainBody);
- return $(body);
+ return $('<div>' + body + '</div>');
}
function moveCaretToEnd(el) {