You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: inline images are not being exported to Markdown at all (verified in playground) and image captions are not exported to Markdown/DOM (instead some other text is used in alt) #5474
I understand that there often is no 1:1 correspondence between the JSON editor state and markdown, but images (inline or URL-based) can somehow be represented by markdown (e.g. by slightly abusing Markdown and using datauri in the  syntax or by returning a dictionary of attachment files along with markdown string which are then addressed by image tags)
I've checked, regular "Insert Image" (non-inline) gets converted to markdown using the datauri syntax, but somehow inline image is not. I think it'd be better in this case to trim the precise inline formatting and still preserve the presence of image instead of the current behavior of completely stripping the image (probably a markdown transformer for InlineImageNode would need to be added to packages/lexical-playground/src/plugins/MarkdownTransformers/index.ts).
changed the title [-]Bug: inline images are not exported to Markdown[/-][+]Bug: inline images are not exported to Markdown in the playground[/+]on Jan 11, 2024
Maybe the better compromise would be to convert these inline images in Markdown as regular images (even if at inverse conversion they would be come regular images and not inline images), or maybe as images with some minor custom HTML
changed the title [-]Bug: inline images are not exported to Markdown in the playground[/-][+]Bug: inline images are not being exported to Markdown at all (verified in playground)[/+]on Jun 27, 2024
Also, caption is not being exported to DOM for non-inline images:
I would propose an option that image caption be exported as alt (at least for markdown it makes more sense). For DOM, maybe it can be exported as <figure><figcaption>...</figcaption><img ... /></figure>
changed the title [-]Bug: inline images are not being exported to Markdown at all (verified in playground)[/-][+]Bug: inline images are not being exported to Markdown at all (verified in playground) and image captions are not exported to Markdown/DOM (instead some other text is used in alt)[/+]on Jun 27, 2024
This is a closed issue about InlineImageNode which no longer exists. If you have feedback about ImageNode you can create a new issue and/or submit a PR. The playground is just demo code, right now adding HTML import/export support for the caption is an exercise for the reader just like other things you would have to do for a production quality ImageNode (e.g. some sort of server-side uploading). Unlike server-side code, it would be straightforward for someone to contribute a less lossy HTML import/export, but commenting on closed issues is one of the worst ways to go about that.
Activity
[-]Bug: inline images are not exported to Markdown[/-][+]Bug: inline images are not exported to Markdown in the playground[/+]vadimkantorov commentedon Jun 12, 2024
Maybe the better compromise would be to convert these inline images in Markdown as regular images (even if at inverse conversion they would be come regular images and not inline images), or maybe as images with some minor custom HTML
vadimkantorov commentedon Jun 27, 2024
After clicking on

M↓nothing gets exported to markdown at all:[-]Bug: inline images are not exported to Markdown in the playground[/-][+]Bug: inline images are not being exported to Markdown at all (verified in playground)[/+]vadimkantorov commentedon Jun 27, 2024
Also, caption is not being exported to DOM for non-inline images:

I would propose an option that image caption be exported as alt (at least for markdown it makes more sense). For DOM, maybe it can be exported as
<figure><figcaption>...</figcaption><img ... /></figure>[-]Bug: inline images are not being exported to Markdown at all (verified in playground)[/-][+]Bug: inline images are not being exported to Markdown at all (verified in playground) and image captions are not exported to Markdown/DOM (instead some other text is used in alt)[/+]kevinfairclough commentedon Jul 17, 2024
Needs a FigurePlugin
Kepron commentedon Sep 13, 2025
Is there any update about this?
vadimkantorov commentedon Sep 21, 2025
At least would be good to export image caption as alt for img tag (and for markdown).
But better would be ImageNode export as figure (at least if caption is set) or alternatively - maybe for now delete caption property from ImageNode
etrepum commentedon Sep 21, 2025
This is a closed issue about InlineImageNode which no longer exists. If you have feedback about ImageNode you can create a new issue and/or submit a PR. The playground is just demo code, right now adding HTML import/export support for the caption is an exercise for the reader just like other things you would have to do for a production quality ImageNode (e.g. some sort of server-side uploading). Unlike server-side code, it would be straightforward for someone to contribute a less lossy HTML import/export, but commenting on closed issues is one of the worst ways to go about that.