sindresorhus / slugify

Slugify a string
MIT License
2.56k stars 81 forks source link

Contractions/possessions removal causes unwanted behavior #72

Closed hanneskuettner closed 1 year ago

hanneskuettner commented 1 year ago

The contractions/possessions removal (PR #71) causes unwanted behavior when it is invoked with a partial string which happens to end on a -s or -t.

In that case the - is removed which might be unwanted if this library is used for live input transformation, eg in https://github.com/directus/directus/issues/18352 For example the user starts to type article title which gets transformed to article-t as soon as the user types the t, which then incorrectly gets turned into articlet.