diff options
author | George Goldberg <george@gberg.me> | 2016-11-03 19:26:00 +0000 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-11-03 15:26:00 -0400 |
commit | 4476adf131dfe72f1245a20499203692acd0e196 (patch) | |
tree | e21ff8d3b010a6f5026f004b53014859688548b5 /webapp/utils/text_formatting.jsx | |
parent | 7d91f179144def7c58cde48a47fc29164930d3a3 (diff) | |
download | chat-4476adf131dfe72f1245a20499203692acd0e196.tar.gz chat-4476adf131dfe72f1245a20499203692acd0e196.tar.bz2 chat-4476adf131dfe72f1245a20499203692acd0e196.zip |
Channel link marker changed from ! to ~ (#4433)
Fixes PLT-4570
Diffstat (limited to 'webapp/utils/text_formatting.jsx')
-rw-r--r-- | webapp/utils/text_formatting.jsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx index dbd6a4e32..5caad05c3 100644 --- a/webapp/utils/text_formatting.jsx +++ b/webapp/utils/text_formatting.jsx @@ -14,7 +14,7 @@ import XRegExp from 'xregexp'; const cjkPattern = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/; // Performs formatting of user posts including highlighting mentions and search terms and converting urls, hashtags, -// @mentions and !channels to links by taking a user's message and returning a string of formatted html. Also takes +// @mentions and ~channels to links by taking a user's message and returning a string of formatted html. Also takes // a number of options as part of the second parameter: // - searchTerm - If specified, this word is highlighted in the resulting html. Defaults to nothing. // - mentionHighlight - Specifies whether or not to highlight mentions of the current user. Defaults to true. @@ -26,7 +26,7 @@ const cjkPattern = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00- // links that can be handled by a special click handler. // - usernameMap - An object mapping usernames to users. If provided, at mentions will be replaced with internal links that can // be handled by a special click handler (Utils.handleFormattedTextClick) -// - channelNamesMap - An object mapping channel display names to channels. If provided, !channel mentions will be replaced with +// - channelNamesMap - An object mapping channel display names to channels. If provided, ~channel mentions will be replaced with // links to the relevant channel. // - team - The current team. export function formatText(text, inputOptions) { @@ -217,7 +217,7 @@ function autolinkChannelMentions(text, tokens, channelNamesMap, team) { if (channelMentionExists(channelNameLower)) { // Exact match - const alias = addToken(channelNameLower, mention, '!' + channelNamesMap[channelNameLower].display_name); + const alias = addToken(channelNameLower, mention, '~' + channelNamesMap[channelNameLower].display_name); return spacer + alias; } @@ -230,7 +230,7 @@ function autolinkChannelMentions(text, tokens, channelNamesMap, team) { if (channelMentionExists(channelNameLower)) { const suffix = originalChannelName.substr(c - 1); - const alias = addToken(channelNameLower, '!' + channelNameLower, '!' + channelNamesMap[channelNameLower].display_name); + const alias = addToken(channelNameLower, '~' + channelNameLower, '~' + channelNamesMap[channelNameLower].display_name); return spacer + alias + suffix; } } else { @@ -243,7 +243,7 @@ function autolinkChannelMentions(text, tokens, channelNamesMap, team) { } let output = text; - output = output.replace(/(^|\s)(!([a-z0-9.\-_]*))/gi, replaceChannelMentionWithToken); + output = output.replace(/(^|\s)(~([a-z0-9.\-_]*))/gi, replaceChannelMentionWithToken); return output; } |