Improve comments.

This commit is contained in:
2025-07-04 17:21:25 +08:00
parent d57a9b6967
commit 2dfa2e3e02
4 changed files with 233 additions and 196 deletions

View File

@@ -282,6 +282,11 @@ func GetCommentByID(commentID uint) (*model.CommentWithRefView, error) {
replyTo = reply
}
return comment.ToViewWithRef(resource, replyTo), nil
v := comment.ToViewWithRef(resource, replyTo)
if v.ReplyTo != nil {
v.ReplyTo.Content, v.ReplyTo.ContentTruncated = restrictCommentLength(v.ReplyTo.Content)
}
return v, nil
}