diff options
-rw-r--r-- | api/slackimport.go | 2 | ||||
-rw-r--r-- | api/slackimport_test.go | 4 | ||||
-rw-r--r-- | webapp/components/suggestion/channel_mention_provider.jsx | 6 | ||||
-rw-r--r-- | webapp/utils/text_formatting.jsx | 10 |
4 files changed, 11 insertions, 11 deletions
diff --git a/api/slackimport.go b/api/slackimport.go index f6ee9fc4c..759514553 100644 --- a/api/slackimport.go +++ b/api/slackimport.go @@ -440,7 +440,7 @@ func SlackConvertChannelMentions(channels []SlackChannel, posts map[string][]Sla l4g.Warn(utils.T("api.slackimport.slack_convert_channel_mentions.compile_regexp_failed.warn"), channel.Id, channel.Name) continue } - regexes["!"+channel.Name] = r + regexes["~"+channel.Name] = r } for channelName, channelPosts := range posts { diff --git a/api/slackimport_test.go b/api/slackimport_test.go index 4da1fa54e..81b79b3d1 100644 --- a/api/slackimport_test.go +++ b/api/slackimport_test.go @@ -110,10 +110,10 @@ func TestSlackConvertChannelMentions(t *testing.T) { expectedPosts := map[string][]SlackPost{ "test-channel": { { - Text: "Go to !one.", + Text: "Go to ~one.", }, { - Text: "Try !two for this.", + Text: "Try ~two for this.", }, }, } 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; } |