Update to new textslice

This commit is contained in:
Paul Frazee 2022-11-04 17:56:48 -05:00
parent f333a90fab
commit 3f730f1173
6 changed files with 40 additions and 34 deletions

View file

@ -63,10 +63,10 @@ export function extractEntities(text: string): Entity[] | undefined {
ents.push({
type: 'mention',
value: match[3],
index: [
match.indices[2][0], // skip the (^|\s) but include the '@'
match.indices[3][1],
],
index: {
start: match.indices[2][0], // skip the (^|\s) but include the '@'
end: match.indices[3][1],
},
})
}
return ents.length > 0 ? ents : undefined