Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
mdast-util-from-markdown
Steps to reproduce
const input = '';
console.dir(fromMarkdown(input), {depth: null});
Actual behavior
It removes the stars from "alt", keeps stars in "title"
{
"alt": "text",
"title": "*title*",
"type": "image",
"url": "image.png",
},
Expected behavior
It should keep stars in "alt" as well.
{
"alt": "*text*",
"title": "*title*",
"type": "image",
"url": "image.png",
},
But, I see that commonmark specs also removes stars from "alt". I couldn't get the rationale of removing stars from "alt", whileas doesn't remove stars from "title". It would be better to keep stars in "alt", so I would use it as a directive for images for transformation in a plugin.
I know, you will close the issue pointing commonmark specs. I just wanted to know the rationale in commonmark specs?
(why I opened this issue is because the next question will be why curly braces are also removed from "alt" attribute of an image when remark-mdx
parse it; at least I would expect curly braces are kept in "alt" when remark-mdx
parse it since commonmark specs also keeps the curly braces in alt attribute. This issue is critic for me because of this discussion)
Runtime
node@latest
Package manager
npm@latest
Operating system
macos@latest
Build and bundle tools
No response