Getting Started
Install
bash
dotnet add package ReverseMarkdownpowershell
Install-Package ReverseMarkdownBasic usage
The examples below assume using ReverseMarkdown;.
csharp
snippet source | anchorvar converter = new Converter();
string html = "This a sample <strong>paragraph</strong> from " +
"<a href=\"http://test.com\">my site</a>";
string result = converter.Convert(html);
// This a sample **paragraph** from [my site](http://test.com)Result:
txt
This a sample **paragraph** from [my site](http://test.com)With configuration
Options are organized into groups on Config. Select an output flavor with Flavor, and set grouped options such as Links, Formatting, and Tags:
csharp
snippet source | anchorvar config = new Config
{
// generate GitHub flavoured markdown (br, pre -> fenced code, task lists)
GithubFlavored = true,
// include unknown tags completely in the result (the default)
Tags = { Unknown = Config.UnknownTagsOption.PassThrough },
// ignore all comments
Formatting = { RemoveComments = true },
// collapse a link to plain text when text and href match
Links = { SmartHref = true },
};
var converter = new Converter(config);See Configuration for the full option reference and Flavors for the available output flavors.
