From b02f813e519dc890f2eb4827ff52cff3ff90c828 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 19 Jun 2022 12:47:32 -0700 Subject: v0.1.0 --- post/util.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'post/util.go') diff --git a/post/util.go b/post/util.go index bc2580b..922dd11 100644 --- a/post/util.go +++ b/post/util.go @@ -472,15 +472,17 @@ func ParseAttachment(obj activitypub.ObjectBase, catalog bool) template.HTML { func ParseContent(board activitypub.Actor, op string, content string, thread activitypub.ObjectBase, id string, _type string) (template.HTML, error) { // TODO: should escape more than just < and >, should also escape &, ", and ' nContent := strings.ReplaceAll(content, `<`, "<") + + if _type == "new" { + nContent = ParseTruncate(nContent, board, op, id) + } + nContent, err := ParseLinkComments(board, op, nContent, thread) if err != nil { return "", util.MakeError(err, "ParseContent") } - if _type == "new" { - nContent = ParseTruncate(nContent, board, op, id) - } nContent = ParseCommentQuotes(nContent) nContent = strings.ReplaceAll(nContent, `/\<`, ">") @@ -497,7 +499,7 @@ func ParseTruncate(content string, board activitypub.Actor, op string, id string content += lines[i] } - content += fmt.Sprintf("(view full post...)", board.Id+"/"+util.ShortURL(board.Outbox, op)+"#"+util.ShortURL(board.Outbox+"/outbox", id)) + content += fmt.Sprintf("(view full post...)", board.Id+"/"+util.ShortURL(board.Outbox, op)+"#"+util.ShortURL(board.Outbox, id)) } return content -- cgit v1.2.3