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 *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.