mirror of
https://github.com/usememos/memos.git
synced 2025-10-20 11:17:25 +08:00
fix: memo content snippet
This commit is contained in:
parent
7c9f967a07
commit
446e38f15b
2 changed files with 1 additions and 3 deletions
|
@ -1301,8 +1301,5 @@ func getMemoContentSnippet(content string) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
plainText := renderer.NewStringRenderer().Render(nodes)
|
plainText := renderer.NewStringRenderer().Render(nodes)
|
||||||
if len(plainText) > 100 {
|
|
||||||
return plainText[:100] + "...", nil
|
|
||||||
}
|
|
||||||
return plainText, nil
|
return plainText, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import "google.golang.org/protobuf/encoding/protojson"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
protojsonUnmarshaler = protojson.UnmarshalOptions{
|
protojsonUnmarshaler = protojson.UnmarshalOptions{
|
||||||
|
AllowPartial: true,
|
||||||
DiscardUnknown: true,
|
DiscardUnknown: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue