How to use the prosemirror-suggest.regexToString function in prosemirror-suggest

To help you get started, we’ve selected a few prosemirror-suggest 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-mention / src / mention-extension.ts View on Github external
return this.options.matchers.map(matcher => {
      const { startOfLine, char, supportedCharacters, name } = {
        ...DEFAULT_MATCHER,
        ...matcher,
      };
      const regexp = new RegExp(
        `(${getRegexPrefix(startOfLine)}${escapeChar(char)}${regexToString(supportedCharacters)})`,
        'g',
      );

      return markPasteRule({
        regexp,
        type,
        getAttrs: str => ({
          id: getMatchString(str.slice(char.length, str.length)),
          label: getMatchString(str),
          name,
        }),
      });
    });
  }

prosemirror-suggest

Primitives for building your prosemirror suggestion and autocomplete functionality

MIT
Latest version published 12 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages