fix emoji

This commit is contained in:
Yasuhiro Matsumoto
2024-02-13 15:16:10 +09:00
committed by fiatjaf_
parent d7dc4b2976
commit efc47e8cc9
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ templ headCommonTemplate(params HeadParams) {
} }
<style> <style>
.note { line-height: 0px; } .note { line-height: 0px; }
.note img { width: 1em; height: 1em; display: inline; margin: 0px; } .note img.emoji { width: 1em; height: 1em; display: inline; margin: 0px; }
@media print { @page { margin: 2cm 3cm; } } @media print { @page { margin: 2cm 3cm; } }
</style> </style>
<meta name="theme-color" content="#e42a6d"/> <meta name="theme-color" content="#e42a6d"/>

View File

@@ -350,7 +350,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
content := data.content content := data.content
for _, tag := range data.event.Tags.GetAll([]string{"emoji"}) { for _, tag := range data.event.Tags.GetAll([]string{"emoji"}) {
if len(tag) >= 3 { if len(tag) >= 3 {
content = strings.ReplaceAll(content, ":"+tag[1]+":", `<img src="`+tag[2]+`"/>`) content = strings.ReplaceAll(content, ":"+tag[1]+":", `<img class="emoji" src="`+tag[2]+`"/>`)
} }
} }
component = noteTemplate(NotePageParams{ component = noteTemplate(NotePageParams{