We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say the word is fook,
I wanna censor it to f**k not ****.
Is it possible through this?
I mean if not is there any way to get the filtered word. So I can replace that substring manually in javascript?
The text was updated successfully, but these errors were encountered:
You can pass custom replaceRegex and placeHolder arguments to the constructor to get the desired result. Here is your solution
replaceRegex
placeHolder
import Filter from "bad-words"; const replaceRegex = /(?<=.).+(?=.)/ const placeHolder = (str)=>("*".repeat(str.length)) var filter = new Filter({replaceRegex, placeHolder}); console.log(filter.clean("This is sh!t"))
output: This is s**t
Sorry, something went wrong.
No branches or pull requests
Let's say the word is fook,
I wanna censor it to f**k not ****.
Is it possible through this?
I mean if not is there any way to get the filtered word. So I can replace that substring manually in javascript?
The text was updated successfully, but these errors were encountered: