mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-01 18:41:05 +02:00
remove unnecessary plus checks in emoji regexes
Signed-off-by: macekj <macekj@umich.edu>
This commit is contained in:
parent
2ffdfaef68
commit
200c061968
@ -34,7 +34,7 @@ const LIMIT = 20;
|
|||||||
|
|
||||||
// Match for ascii-style ";-)" emoticons or ":wink:" shortcodes provided by emojibase
|
// Match for ascii-style ";-)" emoticons or ":wink:" shortcodes provided by emojibase
|
||||||
// anchored to only match from the start of parts otherwise it'll show emoji suggestions whilst typing matrix IDs
|
// anchored to only match from the start of parts otherwise it'll show emoji suggestions whilst typing matrix IDs
|
||||||
const EMOJI_REGEX = new RegExp('(' + EMOTICON_REGEX.source + '|(?:^|\\s|(?<=^\\+)):[+-\\w]*:?)$', 'g');
|
const EMOJI_REGEX = new RegExp('(' + EMOTICON_REGEX.source + '|(?:^|\\s):[+-\\w]*:?)$', 'g');
|
||||||
|
|
||||||
interface IEmojiShort {
|
interface IEmojiShort {
|
||||||
emoji: IEmoji;
|
emoji: IEmoji;
|
||||||
|
@ -47,8 +47,8 @@ import AutocompleteWrapperModel from "../../../editor/autocomplete";
|
|||||||
import DocumentPosition from "../../../editor/position";
|
import DocumentPosition from "../../../editor/position";
|
||||||
import {ICompletion} from "../../../autocomplete/Autocompleter";
|
import {ICompletion} from "../../../autocomplete/Autocompleter";
|
||||||
|
|
||||||
// matches emoticons which follow the start of a line, whitespace, or a plus at the start of a line
|
// matches emoticons which follow the start of a line or whitespace
|
||||||
const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s|^\\+)(' + EMOTICON_REGEX.source + ')\\s$');
|
const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')\\s$');
|
||||||
|
|
||||||
const IS_MAC = navigator.platform.indexOf("Mac") !== -1;
|
const IS_MAC = navigator.platform.indexOf("Mac") !== -1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user