Add enrichment function for post bodies

This commit is contained in:
Dominic Ferrando
2025-04-18 17:00:39 -04:00
parent edd16bcd94
commit f881d7df0a
4 changed files with 36 additions and 5 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
package views
import "fmt"
import "github.com/dominicf2001/comfychan/internal/util"
type CatalogThreadPreview struct {
Subject string
@@ -17,7 +18,9 @@ templ ThreadsCatalog(previews []CatalogThreadPreview) {
<img class="catalog-preview-img" src={ fmt.Sprintf("/static/img/posts/%s", preview.MediaPath) }/>
</a>
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-preview-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
<p>
@templ.Raw(util.EnrichPost(preview.Body))
</p>
</div>
}
</div>