Using "remove" option might introduce untransliterated symbols
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
const slugify = require('slugify');
console.log(slugify('Аленький цветочек')); // Alenkij-cvetochek
console.log(slugify('Аленький цветочек', {remove: /[()]+/g})); // Alenьkij-cvetochek
That happens because slugify first removes the symbol, but then right away adds it back:
(charMap[ch] || ch).replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]/g, '')
charMap['ь'] == ''
charMap['ь'] || 'ь' == 'ь'
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 in slugify.js at the linked line and reproduce the two console examples from the issue. Check the remove-option handling against the character-map lookup; done when using remove does not reintroduce an unmapped symbol such as the Cyrillic soft sign.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100