For my RSS to micropub implementation I needed to generate a decent slug in JS. I found this slugify.js gist by codeguy to which a coder called thierryc made some really nice modifications (but weirdly didn’t publish their own that I could find).

I tested thierry’s code in jsfiddle and found it left a trailing ‘-‘. Using the fiddle I was able to step through the code and see where it went wrong. I just added an extra replace and it worked for me.

I’ve never really found a use for jsfiddle or gists before so this felt good.

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)