Merge pull request #710 from ALawliet/fix-highlight-suspect-banned-words-regex

Make highlight suspect/banned words regex case insensitive
This commit is contained in:
Kim Gardner
2017-06-26 12:48:11 +01:00
committed by GitHub
@@ -54,7 +54,7 @@ class Comment extends React.Component {
// currently the highlighter plugin does not support out of the box.
const searchWords = [...suspectWords, ...bannedWords]
.filter((w) => {
return new RegExp(`(^|\\s)${w}(\\s|$)`).test(comment.body);
return new RegExp(`(^|\\s)${w}(\\s|$)`, 'i').test(comment.body);
})
.concat(linkText);