From 446e38f15be618fb3158d4631565be1ed2f3dbcc Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 16 Jul 2024 22:19:48 +0800 Subject: [PATCH] fix: memo content snippet --- server/router/api/v1/memo_service.go | 3 --- store/db/mysql/common.go | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/server/router/api/v1/memo_service.go b/server/router/api/v1/memo_service.go index 8abcf745..bd8f9441 100644 --- a/server/router/api/v1/memo_service.go +++ b/server/router/api/v1/memo_service.go @@ -1301,8 +1301,5 @@ func getMemoContentSnippet(content string) (string, error) { } plainText := renderer.NewStringRenderer().Render(nodes) - if len(plainText) > 100 { - return plainText[:100] + "...", nil - } return plainText, nil } diff --git a/store/db/mysql/common.go b/store/db/mysql/common.go index 37ffe296..71598749 100644 --- a/store/db/mysql/common.go +++ b/store/db/mysql/common.go @@ -4,6 +4,7 @@ import "google.golang.org/protobuf/encoding/protojson" var ( protojsonUnmarshaler = protojson.UnmarshalOptions{ + AllowPartial: true, DiscardUnknown: true, } )