Remember descriptionAnnotator across composition

Closes mihonapp/mihon#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 Cuong-Tran
parent c525ce49af
commit e3186b3db4
No known key found for this signature in database
GPG key ID: 94EFFE320FE7A47C

View file

@ -871,7 +871,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 -> annotate = { content, child ->
if (!loadImages && child.type == MarkdownElementTypes.IMAGE) { if (!loadImages && child.type == MarkdownElementTypes.IMAGE) {
val inlineLink = child.findChildOfType(MarkdownElementTypes.INLINE_LINK) val inlineLink = child.findChildOfType(MarkdownElementTypes.INLINE_LINK)
@ -909,6 +911,7 @@ private fun descriptionAnnotator(loadImages: Boolean, linkStyle: SpanStyle) = ma
eolAsNewLine = true, eolAsNewLine = true,
), ),
) )
}
@Composable @Composable
private fun MangaSummary( private fun MangaSummary(