Skip to content

Commit fa27048

Browse files
authored
badword.js
1 parent 239e180 commit fa27048

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

badword.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -868,14 +868,15 @@ get ['cleans']() {
868868
if (this.thisToxic[1] === 1 && this.thisToxic.length > 2) {
869869
// If smart processing is enabled
870870
if (this._st === true) {
871-
var sensore = "*"; // Initialize the masking string
871+
//var sensore = "*"; // Initialize the masking string
872872

873873
// Create a string of asterisks of the same length as the toxic word
874-
for (var i = 0; i < this.thisToxic[2].length; i++) {
875-
sensore += "*"; // Append asterisks for each character in the toxic word
876-
}
874+
//for (var i = 0; i < this.thisToxic[2].length; i++) {
875+
// sensore += "*"; // Append asterisks for each character in the toxic word
876+
//}
877877
// Clean the text and replace the toxic word with asterisks
878-
return this.clean(this.position()).replace(this.thisToxic[2], sensore);
878+
return this.clean(this.position()).replace(this.__filt__,
879+
(matchedWord) => '*'.repeat(matchedWord.length));
879880
}
880881

881882
// If smart processing is not enabled, just clean the text

0 commit comments

Comments
 (0)