libfic: remove trailing - at the end of some urlids

This commit is contained in:
nemunaire 2018-01-23 00:59:40 +01:00
parent 57d754acae
commit 44ceeb17d9

View File

@ -2,9 +2,10 @@ package fic
import (
"regexp"
"strings"
)
func ToURLid(str string) string {
re := regexp.MustCompile("[^a-zA-Z0-9]+")
return re.ReplaceAllLiteralString(str, "-")
return strings.TrimSuffix(re.ReplaceAllLiteralString(str, "-"), "-")
}