diff --git a/common.templ b/common.templ index 84a05bf..1c6c7e1 100644 --- a/common.templ +++ b/common.templ @@ -23,7 +23,11 @@ templ headCommonTemplate(params HeadParams) { } else { if params.NaddrNaked != "" { diff --git a/note.templ b/note.templ index 9e40afe..d7eb529 100644 --- a/note.templ +++ b/note.templ @@ -19,7 +19,7 @@ templ noteTemplate(params NotePageParams) { } -
+
@templ.Raw(params.Content)
} diff --git a/render_event.go b/render_event.go index e2fec4a..8cb1463 100644 --- a/render_event.go +++ b/render_event.go @@ -347,6 +347,12 @@ func renderEvent(w http.ResponseWriter, r *http.Request) { enhancedCode = data.naddr } + content := data.content + for _, tag := range data.event.Tags.GetAll([]string{"emoji"}) { + if len(tag) >= 3 { + content = strings.ReplaceAll(content, ":"+tag[1]+":", ``) + } + } component = noteTemplate(NotePageParams{ BaseEventPageParams: baseEventPageParams, OpenGraphParams: opengraph, @@ -359,7 +365,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) { Clients: generateClientList(data.event.Kind, enhancedCode), Details: detailsData, - Content: template.HTML(data.content), + Content: template.HTML(content), Subject: subject, TitleizedContent: titleizedContent, })