MarkdownPlainTextRenderer Class
Renders a Markdown syntax tree as plain text, as MarkdownConverter.ToPlainText of Meziantou.Framework.Markdown 1.x does: the text of the HTML, without its tags and its HTML, and not escaped.
public static class MarkdownPlainTextRendererExample
var tree = MarkdownSyntaxTree.ParseText("# Title\n\nSome **bold** text and [a link](https://example.com).\n\n- First\n- Second");
Assert.Equal("Title\nSome bold text and a link.\nFirst\nSecond\n", MarkdownPlainTextRenderer.ToPlainText(tree));Methods
| Name | Description |
|---|---|
| ToPlainText(MarkdownSyntaxTree) | Renders the document as plain text. |
| ToPlainText(MarkdownSyntaxTree, MarkdownHtmlRendererOptions?) | Renders the document as plain text. |
ToPlainText overloads
ToPlainText(MarkdownSyntaxTree)
MarkdownPlainTextRenderer.csRenders the document as plain text.
public static string ToPlainText(MarkdownSyntaxTree tree)ToPlainText(MarkdownSyntaxTree, MarkdownHtmlRendererOptions?)
MarkdownPlainTextRenderer.csRenders the document as plain text.
public static string ToPlainText(MarkdownSyntaxTree tree, MarkdownHtmlRendererOptions? options)Parameters
treeMarkdownSyntaxTree- The document.
optionsMarkdownHtmlRendererOptions?- How to write the text, or
nullforMarkdownHtmlRendererOptions.Default: only the options that write text are used, such as the characters of SmartyPants, which are written decoded.
Returns
Exceptions
ArgumentNullExceptiontreeisnull.