Remember descriptionAnnotator across composition
Closes #2510 Co-authored-by: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com>
This commit is contained in:
@@ -567,7 +567,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)
|
||||||
@@ -604,7 +606,8 @@ private fun descriptionAnnotator(loadImages: Boolean, linkStyle: SpanStyle) = ma
|
|||||||
config = markdownAnnotatorConfig(
|
config = markdownAnnotatorConfig(
|
||||||
eolAsNewLine = true,
|
eolAsNewLine = true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun MangaSummary(
|
private fun MangaSummary(
|
||||||
|
|||||||
Reference in New Issue
Block a user