Skip to content

Commit 62bce69

Browse files
committed
Remove "normalization" of non-Latin characters in tags
1 parent bb1a5bb commit 62bce69

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

cmd/utils.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import (
1212
)
1313

1414
var (
15-
16-
// This replaces all special characters
17-
tagRegexp = regexp.MustCompile(`[^a-z0-9\-\s]`)
1815
tagRegexpSpaces = regexp.MustCompile(`[\s]+`)
1916
)
2017

@@ -62,14 +59,12 @@ func pqErrMsg(err error) string {
6259
// lowercasing and removing all special characters except for dashes.
6360
func normalizeTags(tags []string) []string {
6461
var (
65-
out []string
66-
space = []byte(" ")
67-
dash = []byte("-")
62+
out []string
63+
dash = []byte("-")
6864
)
6965

7066
for _, t := range tags {
71-
rep := bytes.TrimSpace(tagRegexp.ReplaceAll(bytes.ToLower([]byte(t)), space))
72-
rep = tagRegexpSpaces.ReplaceAll(rep, dash)
67+
rep := tagRegexpSpaces.ReplaceAll(bytes.TrimSpace([]byte(t)), dash)
7368

7469
if len(rep) > 0 {
7570
out = append(out, string(rep))

0 commit comments

Comments
 (0)