app/assets/javascripts/constructor_pages/urlify.js in constructor-pages-1.0.0beta1 vs app/assets/javascripts/constructor_pages/urlify.js in constructor-pages-1.0.0beta2
- old
+ new
@@ -67,9 +67,10 @@
// remove all these words from the string before urlifying
s = downcode(s);
s = s.replace(/[^-\w\s]/g, '-'); // remove unneeded chars
s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens
+ s = s.replace(/^-+|-+$/g, ''); // trim leading/trailing hyphens
s = s.toLowerCase(); // convert to lowercase
return s.substring(0, num_chars);// trim to first num_chars chars
}