Untitled

 avatar
user_6688396
plain_text
a year ago
742 B
8
Indexable
Never
 const unmarkText = (text) => {
    // remove marcas da prop markup e coloca "@[]" em volta do email
    // retira o nome de usuário que estiver dentro do padrão "@()"
    const unmarkedText = text
      .split('@@@__')
      .join('@')
      .split('__@@@')
      .join('@')
      /* eslint-disable-next-line */
      .replace(/ *\@\([^)]*\)*/g, '');
    return unmarkedText;
  };





<Mention
            trigger="@"
            data={mentionData}
            markup="@@@__[__id__]__@@@(__display__)"
            renderSuggestion={entry => handleUsersToRender(entry)}
            displayTransform={(_, mention) => `@${mention}`}
            className="mentions__mention"
            appendSpaceOnAdd
          />