From f3d1683d6562afb30522afb98fb3a22456473275 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 18 Jun 2022 11:48:08 -0700 Subject: fix for report page and archive page formatting --- route/util.go | 7 +++++-- views/archive.html | 4 ++-- views/report.html | 5 ++++- 3 files changed, 11 insertions(+), 5 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, "<", "<") + returnString = strings.ReplaceAll(returnString, ">", ">") + 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 { diff --git a/views/archive.html b/views/archive.html index a5184a4..4df3a57 100644 --- a/views/archive.html +++ b/views/archive.html @@ -27,7 +27,7 @@
{{ .page.Board.Summary }}
+