How to use the emoji-regex/es2015/text function in emoji-regex

To help you get started, we’ve selected a few emoji-regex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / extension-emoji / src / emoji-plugin.ts View on Github external
handleTextInput(view, from, to, text) {
        const { state } = view;
        const originalTr = state.tr;
        let tr: Transaction | undefined;
        if (emojiRegex().exec(text)) {
          tr = replaceNativeEmoji({ from, to, text, emojiData, type, tr: originalTr }) || tr;
        }

        if (tr) {
          view.dispatch(tr);
          return true;
        }
        return false;
      },
    },

emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.

MIT
Latest version published 3 months ago

Package Health Score

83 / 100
Full package analysis