커뮤니티 게시물
- 유료 게시물 글자 수를 기준으로 자를 때 offsetByCodePoints를 사용하여 유니코드 코드 포인트 기준으로 문자열의 length만큼의 끝 인덱스를 계산하여 이모티콘이 잘려서 정상적으로 표시되지 않는 버그 수정
This commit is contained in:
parent
0ea985178e
commit
6daaf22dc0
|
@ -40,9 +40,11 @@ data class SelectCommunityPostResponse @QueryProjection constructor(
|
||||||
content
|
content
|
||||||
} else {
|
} else {
|
||||||
if (content.length > 15) {
|
if (content.length > 15) {
|
||||||
content.substring(0, 15).plus("...")
|
val endIndex = content.offsetByCodePoints(0, 15)
|
||||||
|
content.substring(0, endIndex).plus("...")
|
||||||
} else {
|
} else {
|
||||||
content.substring(0, content.length / 2).plus("...")
|
val endIndex = content.offsetByCodePoints(0, content.length / 2)
|
||||||
|
content.substring(0, endIndex).plus("...")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue