Remember descriptionAnnotator across composition

Closes #2510

Co-authored-by: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
(cherry picked from commit 906d6f3cdbd6f7168d9cdea0c3eb8f9c663a09c2)
This commit is contained in:
AntsyLich
2025-12-27 01:43:39 +06:00
committed by Jobobby04
parent 976b5cc03e
commit 3fc802f837
@@ -605,7 +605,9 @@ private fun ColumnScope.MangaContentInfo(
}
}
private fun descriptionAnnotator(loadImages: Boolean, linkStyle: SpanStyle) = markdownAnnotator(
@Composable
private fun descriptionAnnotator(loadImages: Boolean, linkStyle: SpanStyle) = remember(loadImages, linkStyle) {
markdownAnnotator(
annotate = { content, child ->
if (!loadImages && child.type == MarkdownElementTypes.IMAGE) {
val inlineLink = child.findChildOfType(MarkdownElementTypes.INLINE_LINK)
@@ -642,7 +644,8 @@ private fun descriptionAnnotator(loadImages: Boolean, linkStyle: SpanStyle) = ma
config = markdownAnnotatorConfig(
eolAsNewLine = true,
),
)
)
}
@Composable
private fun MangaSummary(