Fix some more JS linting issues (#2211)

* Minor refactor and linting fixup in `flavours/glitch/actions/accounts.js`

This is some added boilerplate but it's much more consistent with the remaining
of the code, and avoids the linting issue.

* Fix missing /privacy-policy link in DM warning because of wrongly-named import

* Fix unnecessary import

* Fix regexp in flavours/glitch/utils/hashtag.js
This commit is contained in:
Claire
2023-05-08 14:02:41 +02:00
committed by GitHub
parent de74acbe0c
commit 16c5354b8c
5 changed files with 29 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
export function recoverHashtags (recognizedTags, text) {
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);
return matched_hashtag ? matched_hashtag[1] : null;
},