mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-19 05:11:39 +02:00
nip54: trim spaces.
This commit is contained in:
parent
6f32e4da63
commit
01d5dc02c5
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func NormalizeIdentifier(name string) string {
|
||||
name = strings.ToLower(name)
|
||||
name = strings.TrimSpace(strings.ToLower(name))
|
||||
res, _, _ := transform.Bytes(norm.NFKC, []byte(name))
|
||||
runes := []rune(string(res))
|
||||
|
||||
|
@ -10,7 +10,7 @@ func TestNormalization(t *testing.T) {
|
||||
before string
|
||||
after string
|
||||
}{
|
||||
{"hello", "hello"},
|
||||
{" hello ", "hello"},
|
||||
{"Goodbye", "goodbye"},
|
||||
{"the long and winding road / that leads to your door", "the-long-and-winding-road---that-leads-to-your-door"},
|
||||
{"it's 平仮名", "it-s-平仮名"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user