aboutsummaryrefslogtreecommitdiff
path: root/route
diff options
context:
space:
mode:
authorFChannel <>2022-06-18 11:48:08 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commitf3d1683d6562afb30522afb98fb3a22456473275 (patch)
treeab05f4c90674c7dfe5d66d2b83e25dfbf33b5bdc /route
parente13f8001c69375a83efd3ff1bedb367b6851226a (diff)
fix for report page and archive page formatting
Diffstat (limited to 'route')
-rw-r--r--route/util.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/route/util.go b/route/util.go
index 1b0eee7..09c5429 100644
--- a/route/util.go
+++ b/route/util.go
@@ -349,7 +349,7 @@ func TemplateFunctions(engine *html.Engine) {
return template.HTML(link)
})
- engine.AddFunc("shortExcerpt", func(post activitypub.ObjectBase) string {
+ engine.AddFunc("shortExcerpt", func(post activitypub.ObjectBase) template.HTML {
var returnString string
if post.Name != "" {
@@ -366,6 +366,9 @@ func TemplateFunctions(engine *html.Engine) {
returnString = match[0] + "..."
}
+ returnString = strings.ReplaceAll(returnString, "<", "&lt;")
+ returnString = strings.ReplaceAll(returnString, ">", "&gt;")
+
re = regexp.MustCompile(`(^.+\|)`)
match = re.FindStringSubmatch(returnString)
@@ -375,7 +378,7 @@ func TemplateFunctions(engine *html.Engine) {
returnString = strings.Replace(returnString, "|", ":", 1)
}
- return returnString
+ return template.HTML(returnString)
})
engine.AddFunc("parseLinkTitle", func(board string, op string, content string) string {