Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jul 2, 2023
1 parent 1d17063 commit cc11e21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/str.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,11 @@ const Str = {
isValidMention(mention) {
// A valid mention starts with a space or @, or
// starts and ends with a *, _, #, ', or " (with no preceding characters).
if (/[\s@]/g.test(mention.charAt(0)))
if (/[\s@]/g.test(mention.charAt(0))) {
return true;
let firstChar = mention.charAt(0),
lastChar = mention.charAt(mention.length-1);
}
const firstChar = mention.charAt(0);
const lastChar = mention.charAt(mention.length - 1);
return /[*~_#'"]/g.test(firstChar) && /[*~_#'"]/g.test(lastChar) && firstChar === lastChar;
},

Expand Down

0 comments on commit cc11e21

Please sign in to comment.