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
Note that the 1st-level inline tag actually has the content: "content": "![desc *me*|height=100](fig.png)".
But what's different with the image tag: it has children, but it's content is empty.
I'd suggest to let it has a string in content just like the regular inline-tag.
But children property is there to stay, because with the current tag structure it seems to be only good way to conform to CommonMark tests (img tag has an alt attribute with markdown syntax stripped out, so we'd need to store this markdown syntax somewhere).
A regular inline-token has
.content
with it's text.E.g: https://markdown-it.github.io/#md3=%7B%22source%22%3A%22!%5Bdesc%20%2Ame%2A%7Cheight%3D100%5D%28fig.png%20%5C%22title%5C%22%29%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22debug%22%7D%7D
Note the
"content": "my *inline* token"
in the inline tag.But in case of an image, the image
alt
forms 1 more children level. A one more inline token. Here it has no content: https://markdown-it.github.io/#md3=%7B%22source%22%3A%22!%5Bdesc%20%2Ame%2A%7Cheight%3D100%5D%28fig.png%29%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22debug%22%7D%7DNote that the 1st-level inline tag actually has the content:
"content": "![desc *me*|height=100](fig.png)"
.But what's different with the
image
tag: it haschildren
, but it's content is empty.I'd suggest to let it has a string in
content
just like the regular inline-tag.Guess the patch should be somewhere here: https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/image.js#L139 (if appropriate).
The text was updated successfully, but these errors were encountered: