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

Words with accent not moderated #86

Open
GuillaumeDgr opened this issue Sep 14, 2020 · 3 comments
Open

Words with accent not moderated #86

GuillaumeDgr opened this issue Sep 14, 2020 · 3 comments

Comments

@GuillaumeDgr
Copy link

Hi,

With french-badwords-list added, all accented words are not filtered... Any help pls ?
(https://github.com/darwiin/french-badwords-list#readme)
Thanks

@TripleFun-Damian
Copy link

TripleFun-Damian commented Jan 26, 2022

You can remove accents beforehand with the code:

myString.normalize('NFD').replace(/\p{Diacritic}/gu, '')

@GuillaumeDgr
Copy link
Author

Hi, many thanks ! But I have an error : Parsing error: Invalid regular expression: /\p{Diacritic}/: Invalid escape

@TripleFun-Damian
Copy link

That's from 2021 onwards, so it would depend on where you're executing it (Node/browser). You can try one of the other options here: https://stackoverflow.com/a/37511463 such as:

str.normalize("NFD").replace(/[\u0300-\u036f]/g, "")

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