A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat: cut off answer html description
LinkinStarb766824a4eaa
diff --git a/internal/service/answer_common/answer.go b/internal/service/answer_common/answer.goindex ef611351..196d6628 100644--- a/internal/service/answer_common/answer.go+++ b/internal/service/answer_common/answer.go@@ -5,6 +5,7 @@ import ("github.com/answerdev/answer/internal/entity""github.com/answerdev/answer/internal/schema"+ "github.com/answerdev/answer/pkg/htmltext")type AnswerRepo interface {@@ -75,11 +76,11 @@ func (as *AnswerCommon) AdminShowFormat(ctx context.Context, data *entity.Answerinfo := schema.AdminAnswerInfo{}info.ID = data.IDinfo.QuestionID = data.QuestionID- info.Description = data.ParsedTextinfo.Adopted = data.Adoptedinfo.VoteCount = data.VoteCountinfo.CreateTime = data.CreatedAt.Unix()info.UpdateTime = data.UpdatedAt.Unix()info.UserID = data.UserID+ info.Description = htmltext.FetchExcerpt(data.ParsedText, "...", 240)return &info}