badwords icon indicating copy to clipboard operation
badwords copied to clipboard

Fix clean function to remove any bad words with characters or spaces from a string

Open Lapro15 opened this issue 3 years ago • 2 comments

https://github.com/web-mech/badwords/issues/106 https://github.com/web-mech/badwords/issues/108

Clean function does not remove words with characters or spaces between letters, for exemple: "f u c k" or "f*ck". This is due to the split (/ \ b \ /) which separates into words the letters between spaces or the characters before and after the special characters. The function isProfane captures bad words regardless of their form. So I reuse this capture to make the change in the string sent to the clean function.

Lapro15 avatar Apr 16 '21 14:04 Lapro15

Hey! Will this be merged sometime soon...?

timoisalive avatar Jan 10 '22 20:01 timoisalive

this is exactly what i need 😄

JumpyLionnn avatar Jul 12 '22 16:07 JumpyLionnn