Write docs!
This commit is contained in:
parent
c460bb7bf5
commit
bcc598ebd5
37 changed files with 478 additions and 188 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// ToURLid converts the given string to a valid URLid.
|
||||
func ToURLid(str string) string {
|
||||
re := regexp.MustCompile("[^a-zA-Z0-9]+")
|
||||
return strings.TrimSuffix(re.ReplaceAllLiteralString(str, "-"), "-")
|
||||
|
|
Reference in a new issue