From 208bf914b8a5efb3f4474361e4d247826b25788c Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 18 Sep 2015 11:29:52 -0400 Subject: Removed unnecessary conversion of newlines to html line breaks --- web/react/utils/text_formatting.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx index 54d010dbf..5bf3ca52c 100644 --- a/web/react/utils/text_formatting.jsx +++ b/web/react/utils/text_formatting.jsx @@ -33,7 +33,9 @@ export function formatText(text, options = {}) { output = replaceTokens(output, tokens); // replace newlines with html line breaks - output = replaceNewlines(output, options.singleline); + if (options.singleline) { + output = replaceNewlines(output); + } return output; } @@ -246,11 +248,7 @@ function replaceTokens(text, tokens) { return output; } -function replaceNewlines(text, singleline) { - if (!singleline) { - return text.replace(/\n/g, '
'); - } - +function replaceNewlines(text) { return text.replace(/\n/g, ' '); } -- cgit v1.2.3-1-g7c22