Hello. I am using the <multiplatform-markdown-rend...
# compose
t
Hello. I am using the multiplatform-markdown-renderer library by @Mike Penz which leverages the markdown library by Jetbrains. I am trying to change the bullet icon and color of an unordered list. The project README contains an example on how to do this: custom-components
Copy code
components = markdownComponents(
    unorderedList = { it: MarkdownComponentModel ->
            // Use the MarkdownListItems composable to render the list items
            MarkdownListItems(it.content, it.node, level = 0) { index, child ->
                // Create a row layout for each list item with spacing between elements
                Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
                    // Render an icon for the bullet point with a green tint
                    Icon(
                        imageVector = Icons.Default.AddCircle,
                        tint = Color.Green,
                        contentDescription = null,
                        modifier = Modifier.size(20.dp),
                    )
                    // Extract the bullet marker text from the child node
                    val bulletMarker: String = child?.findChildOfType(LIST_BULLET)?.getTextInNode(it.content).toString()
                    // Extract the item text and remove the bullet marker from it
                    val itemText = child?.getTextInNode(it.content).toString().replace(bulletMarker, "")

                    // Render the item text using the MarkdownText composable
                    MarkdownText(content = itemText)
                }
            }
    }
)
In my app this results in: • The new icon appears 👍 • The
-
stays 👎 • The text after the
-
disappears 👎 How can I fix this? Does
MarkdownTokenTypes.LIST_BULLET
correctly identify the leading
-
in an unordered list? https://github.com/JetBrains/markdown/blob/70b10b0aa3b2b8b98920a57f72588676e1b7159[…]kotlin/org/intellij/markdown/flavours/gfm/GFMMarkerProcessor.kt
m
Please use issues on GitHub for support with the library.
t
No problem, will do. I thought the wisdom of the crowd would also be helpful.