forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/follow: fix html IDs for did-webs

this bug prevented following did:web accounts on tangled... because of a
htmx target error.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 0a2ae70c 06409994

verified
Changed files
+4 -2
appview
pages
state
+3 -2
appview/pages/funcmap.go
···
},
"normalizeForHtmlId": func(s string) string {
-
// TODO: extend this to handle other cases?
-
return strings.ReplaceAll(s, ":", "_")
+
normalized := strings.ReplaceAll(s, ":", "_")
+
normalized = strings.ReplaceAll(normalized, ".", "_")
+
return normalized
},
"sshFingerprint": func(pubKey string) string {
fp, err := crypto.SSHFingerprint(pubKey)
+1
appview/state/follow.go
···
subjectIdent, err := s.idResolver.ResolveIdent(r.Context(), subject)
if err != nil {
log.Println("failed to follow, invalid did")
+
return
}
if currentUser.Did == subjectIdent.DID.String() {