Count content length when truncate

This commit is contained in:
LittleSheep 2024-11-13 21:59:53 +08:00
parent 615fe3ff6c
commit e906874b2e

View File

@ -481,6 +481,7 @@ func TruncatePostContent(post models.Post) models.Post {
post.Body["content"] = string([]rune(val)[:length]) + "..."
post.Body["content_truncated"] = true
}
post.Body["content_length"] = len([]rune(val))
}
}