FGRibreau / FGRibreau/node-unidecode

Option to customise or add mappings?

Open
#13 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
151
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Hey @FGRibreau, this is just a quick question about something for the future. As you know Ghost uses unidecode as the basis for it's slugification code and I was thinking about the future of that feature and what we might do with it.

How would you feel about having options added to node-unidecode, so that it was easy to pass in a set of custom mappings?

I was also wondering about whether it would be possible to group the characters into their logical groups with names, to make it possible to enable/disable conversion of certain chars.

These are just ideas for changes that would help in a couple of things for Ghost, although there may be better solutions. We have been getting requests to not convert certain characters for slugs, as URLS can now contain non-ascii chars. We also get requests to change the mappings, I remember one to do with umlauts in German, and where it did or didn't make sense to transliterate with an additional 'e'. That's a bit vague I know, but the upshot is, it might be nice to, one day in a future provide the ability to add user-configurable mappings in Ghost.

Also, I'm tentatively thinking about splitting this bit of the codebase out into it's own npm module, so that others can use it.

I was taking a look at another module which does slugification, https://github.com/dodo/node-slug, however it doesn't do quite the same things as the Ghost one, and as it has it's own mappings, it's not as complete as ours is being based on unidecode.
##

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/29612437-option-to-customise-or-add-mappings?utm_campaign=plugin&utm_content=tracker%2F294213&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F294213&utm_medium=issues&utm_source=github).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.