-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline elements in image descriptions are flattened and stripped #423
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks for the issue! The third case seems like a duplicate of #414 |
Consider the following document:
mdformat
changes the document to this:In the second case, the formatting is removed. In the third case, the formatted inline element is removed completely. This is surprising to me and the case of removing the inline element seems dangerous to me. I would have expected
mdformat
to not change this document.I looked into the CommonMark specification (6.4 Images), which says that an image description can contain inline elements, but that they should be flattened to the plain text content of the elements when rendering to HTML.
This means that in the second case, some information is lost because the document could be rendered to an output format that supports styled image descriptions and in the third case, part of the text is lost.
My setup:
I ran
mdformat
without arguments:The text was updated successfully, but these errors were encountered: