add back missing @https mentions
Ted Unangst tedu@tedunangst.com
Sat, 17 Feb 2024 19:40:33 -0500
M
fun.go
→
fun.go
@@ -406,9 +406,14 @@
func bunchofgrapes(m []string) []Mention { var mentions []Mention for i := range m { - where := gofish(m[i]) + who := m[i] + if strings.HasPrefix(who, "@https://") { + mentions = append(mentions, Mention{Who: who, Where: who[1:]}) + continue + } + where := gofish(who) if where != "" { - mentions = append(mentions, Mention{Who: m[i], Where: where}) + mentions = append(mentions, Mention{Who: who, Where: where}) } } return mentions@@ -586,6 +591,9 @@ }
func attoreplacer(m string) string { fill := `<span class="h-card"><a class="u-url mention" href="%s">%s</a></span>` + if strings.HasPrefix(m, "@https://") { + return fmt.Sprintf(fill, html.EscapeString(m[1:]), html.EscapeString(m)) + } where := gofish(m) if where == "" { return m
M
go.sum
→
go.sum
@@ -17,5 +17,5 @@ humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI=
humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= humungus.tedunangst.com/r/gonix v0.1.4 h1:FuvWYQlFIzmfHxfvIfq5SYpSiHhFcpJqq3pi+w45s78= humungus.tedunangst.com/r/gonix v0.1.4/go.mod h1:VFBc2bPDXr1ayHOmHUutxYu8fSM+pkwK8o36h4rkORg= -humungus.tedunangst.com/r/webs v0.7.9 h1:LC9o2F9joAcf4SxWaRFs5ZqXHSbzdfre9/9BY0gcM0w= -humungus.tedunangst.com/r/webs v0.7.9/go.mod h1:ylhqHSPI0Oi7b4nsnx5mSO7AjLXN7wFpEHayLfN/ugk= +humungus.tedunangst.com/r/webs v0.7.10 h1:DPEsA7DU1P1uOBWYrhJWjqDtll6SGJkWQtJ/2N6P8DI= +humungus.tedunangst.com/r/webs v0.7.10/go.mod h1:ylhqHSPI0Oi7b4nsnx5mSO7AjLXN7wFpEHayLfN/ugk=