Skip to content

Commit

Permalink
fix(detector): only count some chars as boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Jun 25, 2022
1 parent cf32d42 commit cb79e7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion detector/levels/medium.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const badLetters = require('../detection.json').join('');
const lowDetect = require('./low');

module.exports = content => RegExp(`(?<=\\W|^)[${badLetters}]+(?=\\W|$)`, 'iu').test(content) || lowDetect(content);
const boundaries = '[\\s!-/:-@[-`{-¿ -]';

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

0 comments on commit cb79e7b

Please sign in to comment.