-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Snippets.cs
45 lines (35 loc) · 1.13 KB
/
Snippets.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Threading.Tasks;
using ReverseMarkdown;
using VerifyXunit;
using Xunit;
public class Snippets
{
[Fact]
public async Task Usage()
{
#region Usage
var converter = new ReverseMarkdown.Converter();
string html = "This a sample <strong>paragraph</strong> from <a href=\"http://test.com\">my site</a>";
string result = converter.Convert(html);
#endregion
await Verifier.Verify(result);
}
[Fact]
public void UsageWithConfig()
{
#region UsageWithConfig
var config = new ReverseMarkdown.Config
{
// Include the unknown tag completely in the result (default as well)
UnknownTags = Config.UnknownTagsOption.PassThrough,
// generate GitHub flavoured markdown, supported for BR, PRE and table tags
GithubFlavored = true,
// will ignore all comments
RemoveComments = true,
// remove markdown output for links where appropriate
SmartHrefHandling = true
};
var converter = new ReverseMarkdown.Converter(config);
#endregion
}
}