Skip to content

I was about to start working on this feature but I noticed that the issue comes from the default remove regex: #134

@khaledtahadev

Description

@khaledtahadev

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions