From 0a2ae70c248e8b880b6c109e3af8eddc0d69212b Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Wed, 22 Oct 2025 17:55:21 +0100 Subject: [PATCH] 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 --- appview/pages/funcmap.go | 5 +++-- appview/state/follow.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index 0ccb070f..26b94b87 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -297,8 +297,9 @@ func (p *Pages) funcMap() template.FuncMap { }, "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) diff --git a/appview/state/follow.go b/appview/state/follow.go index bd4b847f..9e218cac 100644 --- a/appview/state/follow.go +++ b/appview/state/follow.go @@ -26,6 +26,7 @@ func (s *State) Follow(w http.ResponseWriter, r *http.Request) { 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() { -- 2.51.2