mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user