mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Markdown image inside HTML figure element not transformed #167
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @follesoe on GitHub (Dec 3, 2017).
I'm migrating to markdig from https://github.com/hey-red/Markdown, and have run into an issue. Much of my content comes from a headless CMS, where the images are inserted using the editor, and then wrapped manually in a
<figure>element. I see that markdig has a markdown figure-extension, but since I have so much existing content in this format, and the hey-red/Markdown lib (v.2.2.0) supports this syntax, I'm reporting this in case it is a bug.Outputs the following:
Is this expected behavior or a bug?
@xoofx commented on GitHub (Dec 3, 2017):
Yes, it is expected, as per the CommonMark specs. As you can verify on babelmark
This is because if the line starts by a HTML element, everything inside the HTML element will be output as-is. This is considered as a HTML block in the CommonMark specs.
This is different if you have the following markdown on babelmark
Now the HTML is not a HTML block, but considered as HTML raw inline. So only the HTML tags are left as-is but their content are still considered as markdown content.
@follesoe commented on GitHub (Dec 3, 2017):
I'll stick with Markdown 2.2.0 until I get my content updated (v 2.2.1 has the behavior you describe, so I guess I'm taking advantage of a bug in 2.2.0).
Thanks for the incredible swift reply to my question! And awesome to see a feature rich actively maintained new Markdown library for .NET!