I was about to start working on this feature but I noticed that the issue comes from the default remove regex:
/[^\w\s$*_+~.()'"!\-:@]+/g
This regex removes anything that's not in that list, meaning it preserves only the listed characters. The \w flag stands for the a-zA-Z range, meaning anything except those characters will be removed.
So instead we can update the remove regex to remove only the listed characters:
slugify('السلام عليكم ورحمة الله وبركاته', {
remove: /[$*_+~.()'"!\-:@]+/g
})
And this yields the expected result:
السلام-عليكم-ورحمة-الله-وبركاته
But it didn't work
it return result like this alslam-alykm-wrhmh-allh-wbrkath
I tried to manipulate with the source code and when I remove then Arabic letters from the list charMap it's Works well as expected
Originally posted by @simov in #100 (comment)
I was about to start working on this feature but I noticed that the issue comes from the default
removeregex:/[^\w\s$*_+~.()'"!\-:@]+/gThis regex removes anything that's not in that list, meaning it preserves only the listed characters. The
\wflag stands for thea-zA-Zrange, meaning anything except those characters will be removed.So instead we can update the
removeregex to remove only the listed characters:And this yields the expected result:
But it didn't work
it return result like this
alslam-alykm-wrhmh-allh-wbrkathI tried to manipulate with the source code and when I remove then Arabic letters from the list charMap it's Works well as expected
Originally posted by @simov in #100 (comment)