badwords
badwords copied to clipboard
Fix clean function to remove any bad words with characters or spaces from a string
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.
Hey! Will this be merged sometime soon...?
this is exactly what i need 😄