Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
}),
});
});
}