src/Markdig/Markdown.cs
/// <summary>
/// Converts a Markdown document to HTML.
/// </summary>
/// <param name="document">A Markdown document.</param>
/// <param name="pipeline">The pipeline used for the conversion.</param>
/// <returns>The result of the conversion</returns>
/// <exception cref="ArgumentNullException">if markdown document variable is null</exception>
Converts a Markdown document to HTML.
Converts a Markdown document to HTML .
public static string ToHtml(this MarkdownDocument document, MarkdownPipeline? pipeline = null)
        {
            if (document is null) ThrowHelper.ArgumentNullException(nameof(document));
            pipeline ??= DefaultPipeline;
            using var rentedRenderer = pipeline.RentHtmlRenderer();
            HtmlRenderer renderer = rentedRenderer.Instance;
            renderer.Render(document);
            renderer.Writer.Flush();
            return renderer.Writer.ToString() ?? string.Empty;
        }
public static string ToHtml ( this MarkdownDocument document , MarkdownPipeline ? pipeline = null ) { if ( document is null ) ThrowHelper . ArgumentNullException ( nameof ( document ) ) ; pipeline ??= DefaultPipeline ; using var rentedRenderer = pipeline . RentHtmlRenderer ( ) ; HtmlRenderer renderer = rentedRenderer . Instance ; renderer . Render ( document ) ; renderer . Writer . Flush ( ) ; return renderer . Writer . ToString ( ) ?? string . Empty ; }
Converts a Markdown document to HTML.
Converts a Markdown document to HTML .
The result of the conversion
The result of the conversion
if markdown document variable is null
if markdown document variable is null
MarkdownDocument
this
<not_specific>
pipeline
MarkdownPipeline?
The pipeline used for the conversion.
The pipeline used for the conversion .
document
<not_specific>
A Markdown document.
A Markdown document .