guncebektas / meteor-friendly-slugs

Meteor package to generate URL friendly slugs from a field with auto-incrementation to ensure unique URLs.
65 stars 15 forks source link

numbers seem not supported #16

Closed kevohagan closed 9 years ago

kevohagan commented 9 years ago

Having a posts collection if i have a title field : 'This is post 1', then the slug field is only 'this-is-post'

e.g

_id: "Tav3AC5TDkbiEq5do"
body: "<ol><li><span style="font-style: italic; font-weight: bold;"><br></span></li></ol><hr><ol><li><span style="font-style: italic; font-weight: bold;">This is great shit</span></li></ol>"
category: "Web"
createdAt: Fri Aug 21 2015 14:14:12 GMT+0200 (CEST)
createdBy: "fR2hCFy8Wz6fWn2AN"
slug: "this-is-post"
tags: Array[1]
title: "This is post 1"
todda00 commented 9 years ago

Numbers are supported in the middle of the field, but not at the end. They need to be stripped off in order to compare the slug to others within the collection without a lot of overhead. If you can come up with a way to handle numbers at the end and still perform well, please re-open this and create a PR.

sangyoo91 commented 8 years ago

Is it possible you add an option to disable this?