Skip to content

Commit

Permalink
fix(detector): support unicode in word boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Jun 22, 2022
1 parent a456dcf commit 3a2b549
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detector/levels/medium.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const badLetters = require('../detection.json').join('');
const lowDetect = require('./low');

module.exports = content => RegExp(`\\b[${badLetters}]+\\b`, 'iu').test(content) || lowDetect(content);
module.exports = content => RegExp(`(?<=\\W|^)[${badLetters}]+(?=\\W|$)`, 'iu').test(content) || lowDetect(content);

0 comments on commit 3a2b549

Please sign in to comment.