Bug Description
With the changes introduced in 0.41.0 to image rendering, the logic to extract an image's link, alt text, and the hover tooltip behavior was encapsulated into several helper functions:
ASTNode.resolveImageLink(content, referenceLinkHandler)
ASTNode.resolveImageAlt(content)
ImageAltTooltip(alt, content)
However, because these functions and composables are marked as internal, developers trying to define a custom image component via MarkdownComponents cannot access them.
Steps to Reproduce
When attempting to implement a custom image renderer that still utilizes the built-in tooltip behavior and resolution utilities, we hit compilation barriers:
val customImageComponent: MarkdownComponent = { model ->
// We want to resolve the link and alt text to feed into our custom Composable
val link = model.node.resolveImageLink(model.content, LocalReferenceLinkHandler.current) // Unresolved reference (internal)
val alt = model.node.resolveImageAlt(model.content) // Unresolved reference (internal)
// We want to keep the tooltip wrapper for our custom renderer
ImageAltTooltip(alt) { // Unresolved reference (internal)
MyCustomImageRenderer(link, alt)
}
}
Currently, to get around this, we are forced to copy and paste both the AST-traversal logic and the platform-specific tooltip wrapper logic directly into our local projects.
Expected Behavior
Changing the visibility of these helpers and the composable wrapper from internal to public would allow consumers to cleanly override image components while reusing the core parsing and styling utilities provided by the library.
Checklist
Bug Description
With the changes introduced in
0.41.0to image rendering, the logic to extract an image's link, alt text, and the hover tooltip behavior was encapsulated into several helper functions:ASTNode.resolveImageLink(content, referenceLinkHandler)ASTNode.resolveImageAlt(content)ImageAltTooltip(alt, content)However, because these functions and composables are marked as
internal, developers trying to define a custom image component viaMarkdownComponentscannot access them.Steps to Reproduce
When attempting to implement a custom image renderer that still utilizes the built-in tooltip behavior and resolution utilities, we hit compilation barriers:
Currently, to get around this, we are forced to copy and paste both the AST-traversal logic and the platform-specific tooltip wrapper logic directly into our local projects.
Expected Behavior
Changing the visibility of these helpers and the composable wrapper from
internaltopublicwould allow consumers to cleanly override image components while reusing the core parsing and styling utilities provided by the library.Checklist