diff options
| -rw-r--r-- | web-ui/app/js/helpers/view_helper.js | 5 | ||||
| -rw-r--r-- | web-ui/test/spec/helpers/view_helper.spec.js | 2 | 
2 files changed, 3 insertions, 4 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(        '"': '"',        '\'':''',        '/': '/' -      };      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) { diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index d84cb4ac..7b5b960b 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -56,7 +56,7 @@ define(['helpers/view_helper'], function (viewHelper) {      it('each line of plain text mail gets a new paragraph', function () {        var formattedMail = $('<div></div>');        formattedMail.html(viewHelper.formatMailBody(testData.parsedMail.simpleTextPlain)); -      expect(formattedMail).toContainHtml('<p>Hello Everyone</p>'); +      expect(formattedMail).toContainHtml('<div>Hello Everyone<br/></div>');      });  | 
