Skip to content
New issue

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

Gives TypeError on Russian letters #174

Open
SeanLangre opened this issue Sep 6, 2023 · 1 comment
Open

Gives TypeError on Russian letters #174

SeanLangre opened this issue Sep 6, 2023 · 1 comment

Comments

@SeanLangre
Copy link

Code:

var Filter = require("bad-words");
var badWordFilter = new Filter();

var badwordtest = "мило"
var teststring = badWordFilter.clean(badwordtest);

Error:
Uncaught TypeError TypeError: Cannot read properties of null (reading '0')
at clean (..node_modules\bad-words\lib\badwords.js:58:41)

@myfunc
Copy link

myfunc commented Mar 29, 2024

Need to modify splitRegex prop. By default /\b/ defined as splitter.
To support russian language need to set "/\b/gu". But it still not working with a single world, like "Привет"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants