Add RSS for profiles and relays

This commit is contained in:
Daniele Tonon
2023-11-16 22:58:40 +01:00
parent fb66025667
commit b8345f9176
8 changed files with 189 additions and 27 deletions

View File

@@ -317,6 +317,15 @@ func renderQuotesAsHTML(ctx context.Context, input string, usingTelegramInstantV
})
}
func linkQuotes(input string) string {
return nostrNoteNeventMatcher.ReplaceAllStringFunc(input, func(match string) string {
nip19 := match[len("nostr:"):]
first_chars := nip19[:8]
last_chars := nip19[len(nip19)-4:]
return fmt.Sprintf(`<a href="/%s">%s</a>`, nip19, first_chars+"…"+last_chars)
})
}
func sanitizeXSS(html string) string {
p := bluemonday.UGCPolicy()
p.AllowStyling()