mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 22:34:25 +01:00
fix titlecasing of roles in calendar event template.
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
|
||||||
"html/template"
|
"html/template"
|
||||||
"github.com/nbd-wtf/go-nostr/nip19"
|
"github.com/nbd-wtf/go-nostr/nip19"
|
||||||
"github.com/nbd-wtf/go-nostr/nip52"
|
"github.com/nbd-wtf/go-nostr/nip52"
|
||||||
@@ -28,12 +27,9 @@ func formatParticipants(participants []nip52.Participant) string {
|
|||||||
var list = make([]string, 0)
|
var list = make([]string, 0)
|
||||||
for _, p := range participants {
|
for _, p := range participants {
|
||||||
nreplace, _ := nip19.EncodePublicKey(p.PubKey)
|
nreplace, _ := nip19.EncodePublicKey(p.PubKey)
|
||||||
bytes := []byte(p.Role)
|
|
||||||
bytes[0] = byte(unicode.ToUpper(rune(bytes[0])))
|
|
||||||
role := string(bytes)
|
|
||||||
nreplace = replaceNostrURLsWithHTMLTags(nostrNpubNprofileMatcher, "nostr:"+nreplace)
|
nreplace = replaceNostrURLsWithHTMLTags(nostrNpubNprofileMatcher, "nostr:"+nreplace)
|
||||||
if p.Role != "" {
|
if p.Role != "" {
|
||||||
nreplace = nreplace + " as " + role
|
nreplace = nreplace + " as " + strings.ToTitle(p.Role)
|
||||||
}
|
}
|
||||||
list = append(list, nreplace)
|
list = append(list, nreplace)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user