public static string ToHtml(string markdown) { var markdownPipelineBuilder = new MarkdownPipelineBuilder() .DisableHtml() .UseAutoLinks(); markdownPipelineBuilder .Extensions .AddIfNotAlready <UnescapedFencedCodeBlockExtension>(); var pipeline = markdownPipelineBuilder.Build(); return(MarkdownHelper.ToHtml(markdown ?? string.Empty, pipeline)); }
public void Render(string source, out string html, out string tree) { using (var sw = new StringWriter()) { var doc = Markdown.ToHtml(source, sw, Pipeline); html = sw.ToString(); var node = new HeadingNode(); foreach (var item in doc) { if (item is HeadingBlock hb) { node.Insert(new HeadingNode { Id = hb.GetAttributes().Id, Level = hb.Level, Title = hb.Inline?.FirstChild.ToString() }); } } tree = node.ToString(); } }
public string Render(string source) { return(Markdown.ToHtml(source, Pipeline)); }
public string ToHtml(string text) { return(Markdigger.ToHtml(text, pipeline)); }