Merge pull request '커뮤니티 게시물' (#195) from test into main

Reviewed-on: #195
This commit is contained in:
klaus 2024-06-17 14:09:26 +00:00
commit fb91398462
1 changed files with 3 additions and 2 deletions

View File

@ -39,11 +39,12 @@ data class SelectCommunityPostResponse @QueryProjection constructor(
if (existOrdered) {
content
} else {
if (content.length > 15) {
val length = content.codePointCount(0, content.length)
if (length > 15) {
val endIndex = content.offsetByCodePoints(0, 15)
content.substring(0, endIndex).plus("...")
} else {
val endIndex = content.offsetByCodePoints(0, content.length / 2)
val endIndex = content.offsetByCodePoints(0, length / 2)
content.substring(0, endIndex).plus("...")
}
}