Two-way conversion/Html.ToMarkdown support #89

Open
opened 2026-01-29 14:26:01 +00:00 by claunia · 3 comments
Owner

Originally created by @KirkMunro on GitHub (Feb 2, 2017).

Have you thought about adding to this library so that it supports HTML to Markdown as well? There are a number of other libraries out there that are really basic (and flawed), that's left me wondering how difficult it would be to extend this to support conversion the other way.

Originally created by @KirkMunro on GitHub (Feb 2, 2017). Have you thought about adding to this library so that it supports HTML to Markdown as well? There are a number of other libraries out there that are really basic (and flawed), that's left me wondering how difficult it would be to extend this to support conversion the other way.
claunia added the enhancementPR Welcome! labels 2026-01-29 14:26:01 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 3, 2017):

Imho, it is not really "extend"... but more a separate project, using something like AngleSharp. Ideally, even the HtmlRenderer in markdig could have been a package developed outside core markdig... though for 90% of usage, people are looking for translating Markdown to HTML, so I don't like to introduce separate packages for the sake of software design when common usage shows differently...

So I don't have any objection to this idea, but as part of a separated project (note that it could be integrated into this repo). PR welcome, as I really don't have any spare time left for this (or even currently personal interests 😅 )

@xoofx commented on GitHub (Feb 3, 2017): Imho, it is not really "extend"... but more a separate project, using something like [AngleSharp](https://github.com/AngleSharp/AngleSharp). Ideally, even the `HtmlRenderer` in markdig could have been a package developed outside core markdig... though for 90% of usage, people are looking for translating Markdown to HTML, so I don't like to introduce separate packages for the sake of software design when common usage shows differently... So I don't have any objection to this idea, but as part of a separated project (note that it could be integrated into this repo). PR welcome, as I really don't have any spare time left for this (or even currently personal interests 😅 )
Author
Owner

@HardcoreMagazine commented on GitHub (Sep 19, 2023):

I found this tool suitable for the task:
https://github.com/mysticmind/reversemarkdown-net

@HardcoreMagazine commented on GitHub (Sep 19, 2023): I found this tool suitable for the task: https://github.com/mysticmind/reversemarkdown-net
Author
Owner

@Atulin commented on GitHub (Apr 23, 2025):

Seems like the forementioned tool would only be useful in case of basic Markdown. I have some custom extensions added to Markdig (user mentions, spoiler tags, etc) so it would not be able to reverse that.

One of the reasons why I'd hope for something like it to be more integrated into Markdig, so that it could integrate with the extensions as well.

@Atulin commented on GitHub (Apr 23, 2025): Seems like the forementioned tool would only be useful in case of basic Markdown. I have some custom extensions added to Markdig (user mentions, spoiler tags, etc) so it would not be able to reverse that. One of the reasons why I'd hope for something like it to be more integrated into Markdig, so that it could integrate with the extensions as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#89