Skip to content

Image rendering is not using the provided component #498

@Azadios

Description

@Azadios

Bug Description

Image link is always parsed as a paragraph with a text containing an inline image. (If you suspect it might be a JB markdown parser bug please tell me, I will take a look)
And this library code seems to not use the provided image component for the inline image rendering (see MarkdownText).
I couldn't make any markdown text to render the provided image component (which as I understand used for standalone images within markdown, which is never actually parsed) and there is no way to provide a component for an inline image.
So the end bug is that it's impossible to configure image rendering.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Add this code
Markdown(
  content = "![Minion](https://octodex.github.com/images/minion.png)",
  imageTransformer = Coil3ImageTransformerImpl,
  components = markdownComponents(
    image = {
      Text(it.content)
    },
  )
)
  1. Run web JS (probably reproducible on any target)
  2. See the image rendered

Expected Behavior

Expected to see the content as text instead of the image as per provided image component.

Screenshots

Image

Environment

  • Library Version: 0.39.0
  • Platform: Web JS
  • Device: PC, Pixel 9A
  • OS Version: Ubuntu 24.04.3, Android 16
  • Kotlin Version: 2.3.0
  • Compose Version: 1.9.3
  • Coil Version: 3.2.0

Additional Context

If you're too busy I can help and contribute, but I need guidance on the proper solution here. Is it to add another component for inline images, fix JB markdown parser, both, neither but something else?

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions