Bug Description
First of all, thank you for your great work.
Inline images behave incorrectly when their height exceeds the text line height.
Steps to Reproduce
Add the following code and run it (a preview in the Android emulator is sufficient):
@Composable
private fun BrokenInlineImage() {
val text = """
## Working inline
${inlineImage(width = 20)} and ${inlineImage(width = 100)} and ${inlineImage(width = 2000)}
## Broken inline
This is a multiline text which breaks inline image rendering because the height of the entire container is considered instead of the text line height.
${inlineImage(width = 100, height = 300)}
""".trimIndent()
ComposeMarkdown(
content = text,
colors = markdownColor(),
typography = markdownTypography(),
padding = markdownPadding(),
imageTransformer = Coil3ImageTransformerImpl,
)
}
private fun inlineImage(width: Int = 60, height: Int = 60): String =
""
Expected Behavior
At minimum, images should not overlap with text.
Possible fallback behaviors could be:
• Rendering the image as a block element (non-inline), or
• Scaling the image to match the text line height.
Screenshots
Multiplatform Markdown Renderer
Other Renderers
Other Markdown renderers handle this scenario differently (there doesn’t seem to be a strict standard):
Environment
- Library Version: 0.40.2
- Platform: Android
- Device: Emulator Resizable API 35, Redmi Pad API 34
- Kotlin Version: 2.3.20
- Compose Version: 2026.03.01
Checklist
Bug Description
First of all, thank you for your great work.
Inline images behave incorrectly when their height exceeds the text line height.
Steps to Reproduce
Add the following code and run it (a preview in the Android emulator is sufficient):
Expected Behavior
At minimum, images should not overlap with text.
Possible fallback behaviors could be:
• Rendering the image as a block element (non-inline), or
• Scaling the image to match the text line height.
Screenshots
Multiplatform Markdown Renderer
Other Renderers
Other Markdown renderers handle this scenario differently (there doesn’t seem to be a strict standard):
Environment
Checklist