1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

No slug? Then no '-' separator! (#1351)

* Stop using slug separator when there is no slug

* Changing as per upstream requirements
This commit is contained in:
Johann Rodríguez
2018-02-08 20:52:50 +00:00
committed by Toby Zerner
parent 6922c3081e
commit 0fedee8f80
4 changed files with 5 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ export function slug(string) {
return string.toLowerCase()
.replace(/[^a-z0-9]/gi, '-')
.replace(/-+/g, '-')
.replace(/-$|^-/g, '') || '-';
.replace(/-$|^-/g, '');
}
/**