Tobias Preuss
01/26/2025, 12:02 AMcomponents = 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.ktMike Penz
01/26/2025, 2:18 PMTobias Preuss
01/26/2025, 2:48 PMTobias Preuss
01/26/2025, 3:21 PM