in js/src/extractMentionsOrListsWithIndices.js [9:31]
export default function(text) {
if (!text || !text.match(atSigns)) {
return [];
}
const possibleNames = [];
text.replace(validMentionOrList, function(match, before, atSign, screenName, slashListname, offset, chunk) {
const after = chunk.slice(offset + match.length);
if (!after.match(endMentionMatch)) {
slashListname = slashListname || '';
const startPosition = offset + before.length;
const endPosition = startPosition + screenName.length + slashListname.length + 1;
possibleNames.push({
screenName: screenName,
listSlug: slashListname,
indices: [startPosition, endPosition]
});
}
});
return possibleNames;
}