From 2cbe39d723d429a8aea7601d37da8b694f77a81b Mon Sep 17 00:00:00 2001 From: Bruno Wagner and Fabio Pio Date: Fri, 16 Jan 2015 19:40:55 -0200 Subject: Fixing jshint warnings --- web-ui/app/js/helpers/view_helper.js | 18 +++++++++--------- web-ui/test/spec/helpers/view_helper.spec.js | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'web-ui') diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index bb909cea..22ab1324 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -35,30 +35,30 @@ define( return textPlainBody.replace(/^(.*?)$/mg, '

$1

'); } - function escapeHtmlTags (body) { + function escapeHtmlTags(body) { var escapeIndex = { - "&": "&", - "<": "<", - ">": ">", + '&': '&', + '<': '<', + '>': '>', '"': '"', - "'":''', - "/": '/' + '\'':''', + '/': '/' }; return body.replace(/["'<>\/&]/g, function(char){ return escapeIndex[char]; - } ) + }); } - function escapeHtmlAndAddParagraphs (body) { + function escapeHtmlAndAddParagraphs(body) { var escapedBody = escapeHtmlTags(body); return addParagraphsToPlainText(escapedBody); } - function formatMailBody (mail) { + function formatMailBody(mail) { var body = mail.htmlBodyPart ? htmlWhitelister.sanitize(mail.htmlBody, htmlWhitelister.tagPolicy) : escapeHtmlAndAddParagraphs(mail.textPlainBody); diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index b975dcd9..d84cb4ac 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -63,9 +63,9 @@ define(['helpers/view_helper'], function (viewHelper) { it('escape html in plain text body', function () { var formattedMail = $('
'); var mail = testData.parsedMail.simpleTextPlain; - mail.textPlainBody = 'This is some text!' + mail.textPlainBody = 'This is some text!'; formattedMail.html(viewHelper.formatMailBody(mail)); - expect(formattedMail.text()).toBe('This is some text!') + expect(formattedMail.text()).toBe('This is some text!'); }); -- cgit v1.2.3