2018-08-28 05:40:19 -05:00
|
|
|
export function recoverHashtags (recognizedTags, text) {
|
|
|
|
return recognizedTags.map(tag => {
|
2023-02-13 08:12:14 -06:00
|
|
|
const re = new RegExp(`(?:^|[^/)\w])#(${tag.name})`, 'i');
|
2023-02-03 13:52:07 -06:00
|
|
|
const matched_hashtag = text.match(re);
|
|
|
|
return matched_hashtag ? matched_hashtag[1] : null;
|
|
|
|
},
|
2019-02-01 04:41:34 -06:00
|
|
|
).filter(x => x !== null);
|
2018-08-28 05:40:19 -05:00
|
|
|
}
|