8
app/javascript/flavours/glitch/util/hashtag.js
Normal file
8
app/javascript/flavours/glitch/util/hashtag.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export function recoverHashtags (recognizedTags, text) {
|
||||
return recognizedTags.map(tag => {
|
||||
const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i');
|
||||
const matched_hashtag = text.match(re);
|
||||
return matched_hashtag ? matched_hashtag[1] : tag;
|
||||
}
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user