mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-11 01:12:12 -05:00
[Glitch] Fix useless regular-expression character escape detected by CodeQL
This commit is contained in:
parent
8ce02aa6e8
commit
3c451cf88f
@ -1,6 +1,6 @@
|
|||||||
export function recoverHashtags (recognizedTags, text) {
|
export function recoverHashtags (recognizedTags, text) {
|
||||||
return recognizedTags.map(tag => {
|
return recognizedTags.map(tag => {
|
||||||
const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i');
|
const re = new RegExp(`(?:^|[^\/)\w])#(${tag.name})`, 'i');
|
||||||
const matched_hashtag = text.match(re);
|
const matched_hashtag = text.match(re);
|
||||||
return matched_hashtag ? matched_hashtag[1] : null;
|
return matched_hashtag ? matched_hashtag[1] : null;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user