src/Markdig/Markdown.cs
/// <summary>
/// Converts a Markdown string to HTML and output to the specified writer.
/// </summary>
/// <param name="markdown">A Markdown text.</param>
/// <param name="writer">The destination <see cref="TextWriter"/> that will receive the result of the conversion.</param>
/// <param name="pipeline">The pipeline used for the conversion.</param>
/// <param name="context">A parser context used for the parsing.</param>
/// <returns>The Markdown document that has been parsed</returns>
/// <exception cref="ArgumentNullException">if reader or writer variable are null</exception>
Converts a Markdown string to HTML and output to the specified writer.
Converts a Markdown string to HTML and output to the specified writer .
public static MarkdownDocument ToHtml(string markdown, TextWriter writer, MarkdownPipeline? pipeline = null, MarkdownParserContext? context = null)
        {
            if (markdown is null) ThrowHelper.ArgumentNullException_markdown();
            if (writer is null) ThrowHelper.ArgumentNullException_writer();
            pipeline = GetPipeline(pipeline, markdown);
            var document = MarkdownParser.Parse(markdown, pipeline, context);
            using var rentedRenderer = pipeline.RentHtmlRenderer(writer);
            HtmlRenderer renderer = rentedRenderer.Instance;
            renderer.Render(document);
            writer.Flush();
            return document;
        }
public static MarkdownDocument ToHtml ( string markdown , TextWriter writer , MarkdownPipeline ? pipeline = null , MarkdownParserContext ? context = null ) { if ( markdown is null ) ThrowHelper . ArgumentNullException_markdown ( ) ; if ( writer is null ) ThrowHelper . ArgumentNullException_writer ( ) ; pipeline = GetPipeline ( pipeline , markdown ) ; var document = MarkdownParser . Parse ( markdown , pipeline , context ) ; using var rentedRenderer = pipeline . RentHtmlRenderer ( writer ) ; HtmlRenderer renderer = rentedRenderer . Instance ; renderer . Render ( document ) ; writer . Flush ( ) ; return document ; }
Converts a Markdown string to HTML and output to the specified writer.
Converts a Markdown string to HTML and output to the specified writer .
The Markdown document that has been parsed
The Markdown document that has been parsed
if reader or writer variable are null
if reader or writer variable are null
markdown
string
A Markdown text.
A Markdown text .
writer
TextWriter
The destination  that will receive the result of the conversion.
The destination that will receive the result of the conversion .
pipeline
MarkdownPipeline?
The pipeline used for the conversion.
The pipeline used for the conversion .
context
MarkdownParserContext?
A parser context used for the parsing.
A parser context used for the parsing .