This repository has been archived on 2025-06-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
server/libfic/utils.go

11 lines
195 B
Go

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