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 | |
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')
-rw-r--r-- | webapp/components/suggestion/channel_mention_provider.jsx | 6 | ||||
-rw-r--r-- | webapp/utils/text_formatting.jsx | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/webapp/components/suggestion/channel_mention_provider.jsx b/webapp/components/suggestion/channel_mention_provider.jsx index 0058bcc73..d80433271 100644 --- a/webapp/components/suggestion/channel_mention_provider.jsx +++ b/webapp/components/suggestion/channel_mention_provider.jsx @@ -24,7 +24,7 @@ class ChannelMentionSuggestion extends Suggestion { className += ' suggestion--selected'; } - const description = '(!' + item.channel.name + ')'; + const description = '(~' + item.channel.name + ')'; return ( <div @@ -72,7 +72,7 @@ function filterChannelsByPrefix(channels, prefix, limit) { export default class ChannelMentionProvider { handlePretextChanged(suggestionId, pretext) { - const captured = (/(^|\s)(!([^!]*))$/i).exec(pretext.toLowerCase()); + const captured = (/(^|\s)(~([^~]*))$/i).exec(pretext.toLowerCase()); if (captured) { const prefix = captured[3]; @@ -122,7 +122,7 @@ export default class ChannelMentionProvider { const wrapped = wrappedChannels.concat(wrappedMoreChannels); - const mentions = wrapped.map((item) => '!' + item.channel.name); + const mentions = wrapped.map((item) => '~' + item.channel.name); SuggestionStore.clearSuggestions(suggestionId); SuggestionStore.addSuggestions(suggestionId, mentions, wrapped, ChannelMentionSuggestion, captured[2]); 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; } |