From 5b917dd4a6fc4259cd17ad0b2e106f3b71254ef2 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 16 Jul 2015 16:58:05 -0400 Subject: Trim the carets from the beginning of reply messages when they're posted --- web/react/components/create_post.jsx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/react') diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 7bc5e2481..a3e354599 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -71,6 +71,11 @@ module.exports = React.createClass({ post.root_id = this.state.rootId; post.parent_id = this.state.parentId; + // if this is a reply, trim off any carets from the beginning of a message + if (post.root_id && post.message.startsWith("^")) { + post.message = post.message.replace(/^\^+\s*/g, ""); + } + client.createPost(post, ChannelStore.getCurrent(), function(data) { PostStore.storeDraft(data.channel_id, data.user_id, null); -- cgit v1.2.3-1-g7c22