How to obtain HTML DOM from markdown?
11:51 17 Nov 2025

I have some markdown text.

I use MarkDig to parse the markdown text and obtain a markdown-document-object-model. (markdown-DOM.)

From that, I want to obtain an HTML-DOM.

As far as I can tell, the only thing MarkDig can easily do in that direction is to convert the markdown-DOM into HTML text.

This means that I would then have to use some other HTML library (e.g. HtmlAgilityPack (site, GitHub) or AngleSharp) to parse that HTML text into an HTML-DOM.

This is a bit too roundabout for my taste.

So, how can I produce an HTML-DOM from the markdown-DOM generated by MarkDig?

Note: I do not have to use MarkDig, so if there is some other library that produces a markdown-DOM which is easier to convert to an HTML DOM, I am open to it.

c# html dom markdown markdig