Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert HTML to MarkDown in c#? [duplicate]

Tags:

html

c#

markdown

What is the best way to convert HTML into Markdown?

I am using C# and the he amount of text being converted would be less than 300 characters or so.

I think:

  • Regular expression (This aticle Do NOT try parsing with regular expressions, recommends to not do this)
  • XSLT File (requires is that the HTML you want to convert which must be valid XML)
like image 546
LeMoussel Avatar asked Oct 23 '22 12:10

LeMoussel


1 Answers

Pandoc seems to be a good solution.

This Stackoverflow post Convert Html or RTF to Markdown or Wiki Compatible syntax? explain how to wrap Pandoc in C#

like image 73
LeMoussel Avatar answered Nov 01 '22 07:11

LeMoussel