mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
closes #885
This commit is contained in:
@@ -106,6 +106,7 @@
|
|||||||
collapseWhitespace : /\s+/g,
|
collapseWhitespace : /\s+/g,
|
||||||
collapseDash : /-+/g,
|
collapseDash : /-+/g,
|
||||||
trimTrailingDash : /-$/g,
|
trimTrailingDash : /-$/g,
|
||||||
|
trimLeadingDash : /^-/g,
|
||||||
isLatin : /^[\w]+$/,
|
isLatin : /^[\w]+$/,
|
||||||
|
|
||||||
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
|
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
|
||||||
@@ -120,6 +121,7 @@
|
|||||||
str = str.replace(utils.collapseWhitespace, '-')
|
str = str.replace(utils.collapseWhitespace, '-')
|
||||||
str = str.replace(utils.collapseDash, '-');
|
str = str.replace(utils.collapseDash, '-');
|
||||||
str = str.replace(utils.trimTrailingDash, '');
|
str = str.replace(utils.trimTrailingDash, '');
|
||||||
|
str = str.replace(utils.trimLeadingDash, '');
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user