libfic: remove trailing - at the end of some urlids
This commit is contained in:
parent
57d754acae
commit
44ceeb17d9
@ -2,9 +2,10 @@ package fic
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ToURLid(str string) string {
|
func ToURLid(str string) string {
|
||||||
re := regexp.MustCompile("[^a-zA-Z0-9]+")
|
re := regexp.MustCompile("[^a-zA-Z0-9]+")
|
||||||
return re.ReplaceAllLiteralString(str, "-")
|
return strings.TrimSuffix(re.ReplaceAllLiteralString(str, "-"), "-")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user