diff options
author | Corey Hulen <corey@hulen.com> | 2015-06-18 23:08:01 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-06-18 23:08:01 -0800 |
commit | 1ec7996e4c798569d86b4135fae9653c386ac352 (patch) | |
tree | 32fcf3414efe0015389b46570cd122a45a5629b9 /web/react | |
parent | d519f678e6d888cbfb06129e31f4ec9eb2a3b64f (diff) | |
parent | 9f86db9faa454757550cfb1d705acc672c94609c (diff) | |
download | chat-1ec7996e4c798569d86b4135fae9653c386ac352.tar.gz chat-1ec7996e4c798569d86b4135fae9653c386ac352.tar.bz2 chat-1ec7996e4c798569d86b4135fae9653c386ac352.zip |
Merge pull request #33 from mattermost/br-fix
HELIUM fixes br tags causing new lines
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/create_post.jsx | 4 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 191be9bf8..a534e495d 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -31,9 +31,7 @@ module.exports = React.createClass({ post.message = this.state.messageText; - var repRegex = new RegExp("<br>", "g"); - if (post.message.replace(repRegex, " ").trim().length === 0 - && this.state.previews.length === 0) { + if (post.message.trim().length === 0 && this.state.previews.length === 0) { return; } diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index e57088614..fb4f3a34e 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -366,9 +366,6 @@ module.exports.textToJsx = function(text, options) { if (options && options['singleline']) { var repRegex = new RegExp("\n", "g"); text = text.replace(repRegex, " "); - } else { - var repRegex = new RegExp("\n", "g"); - text = text.replace(repRegex, "<br>"); } var searchTerm = "" @@ -392,7 +389,7 @@ module.exports.textToJsx = function(text, options) { implicitKeywords[keywordArray[i]] = true; } - var lines = text.split("<br>"); + var lines = text.split("\n"); var urlMatcher = new LinkifyIt(); for (var i = 0; i < lines.length; i++) { var line = lines[i]; |