BugFix for trimmed paragraphs losing indentation

This commit is contained in:
Vitor Pamplona
2023-06-29 16:46:44 -04:00
parent b2cdc2ddef
commit e6f122d8b7

View File

@@ -162,9 +162,9 @@ private fun RenderParagraph(
) {
val s = remember(paragraph) {
if (isArabic(paragraph)) {
paragraph.trim().split(' ').reversed().toImmutableList()
paragraph.split(' ').reversed().toImmutableList()
} else {
paragraph.trim().split(' ').toImmutableList()
paragraph.split(' ').toImmutableList()
}
}
@@ -236,6 +236,9 @@ private fun RenderWord(
tags: ImmutableListOfLists<String>
) {
val type = remember(word) {
if (word == "") {
WordType.OTHER
}
if (state.imagesForPager[word] != null) {
WordType.IMAGE
} else if (state.urlSet.contains(word)) {
@@ -799,6 +802,7 @@ data class HashWordWithExtra(val hashtag: String, val extras: String?)
fun HashTag(word: String, nav: (String) -> Unit) {
var tagSuffixPair by remember { mutableStateOf<HashWordWithExtra?>(null) }
if (tagSuffixPair == null) {
LaunchedEffect(key1 = word) {
launch(Dispatchers.IO) {
val hashtagMatcher = hashTagsPattern.matcher(word)
@@ -818,6 +822,7 @@ fun HashTag(word: String, nav: (String) -> Unit) {
}
}
}
}
Crossfade(targetState = tagSuffixPair) {
if (it != null) {