//str:markdown文本 var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); result = Markdown.ToHtml(str, pipeline);
MarkDownSharp
代码如下
1 2 3 4 5 6 7 8
//content:markdown文本 writer:Html结果 using (var reader = new StringReader(content)) { using (var writer = new StringWriter()) { CommonMark.CommonMarkConverter.Convert(reader, writer); } }