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