libfic: remove trailing - at the end of some urlids

This commit is contained in:
nemunaire 2018-01-23 00:59:40 +01:00
parent 2e3b262a78
commit 8ae4d1c42f
1 changed files with 2 additions and 1 deletions

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, "-"), "-")
}