Open raydog opened 8 years ago
I added your test for multiple leading and trailing separators in my fork here: https://github.com/larvit/larvitslugify/commit/e1500dd83adeca0d10ee82ebc9621b44c10899ae
But since I rewrote the base code quite a bit for a lot of reasons, I made it an option to remove multiple whitespaces. That collides with hard coding something that removes multiple instances of the replace character as well... I have no pretty solution for this, do you?
Fixes two bugs I found while reading the source code:
This is similar to PR #55, except that this code escapes the separator, so it should still work when the replacement character is a regexp character.