1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 12:08:43 +00:00

add subcondition for adding subparts in raw message entities

This commit is contained in:
InsanusMokrassar 2020-01-05 19:50:04 +06:00
parent 72127ce133
commit b095f07b9c

View File

@ -39,7 +39,7 @@ internal fun RawMessageEntity.asTextParts(source: String, subParts: List<TextPar
else -> RegularTextSource(sourceSubstring)
}.let {
val part = TextPart(range, it)
if (it !is MultilevelTextSource) {
if (it !is MultilevelTextSource && subParts.isNotEmpty()) {
(subParts + part).sortedBy { currentPart -> currentPart.range.first }
} else {
listOf(part)