I was about to start working on this feature but I noticed that the issue comes from the default `remove` regex:
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
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 https://github.com/simov/slugify/issues/100#issuecomment-782843177
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the default remove regex and the source charMap, as both are identified as affecting Arabic transliteration. Reproduce the Arabic example from the issue and compare the output with the expected Arabic slug; done means the intended remove option preserves Arabic characters instead of transliterating them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100