src/Markdig/Markdown.cs
/// <summary>
/// Converts a Markdown string to Plain text 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 Plain text and output to the specified writer.
Converts a Markdown string to Plain text and output to the specified writer .
public static MarkdownDocument ToPlainText(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);
            var renderer = new HtmlRenderer(writer)
            {
                EnableHtmlForBlock = false,
                EnableHtmlForInline = false,
                EnableHtmlEscape = false,
            };
            pipeline.Setup(renderer);
            renderer.Render(document);
            writer.Flush();
            return document;
        }
public static MarkdownDocument ToPlainText ( 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 ) ; var renderer = new HtmlRenderer ( writer ) { EnableHtmlForBlock = false , EnableHtmlForInline = false , EnableHtmlEscape = false , } ; pipeline . Setup ( renderer ) ; renderer . Render ( document ) ; writer . Flush ( ) ; return document ; }
Converts a Markdown string to Plain text and output to the specified writer.
Converts a Markdown string to Plain text and output to the specified writer .
// We override the renderer with our own 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 .