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:
parent
c525ce49af
commit
e3186b3db4
1 changed files with 34 additions and 31 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue