forked from xoofx/markdig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSmartyPants.cs
More file actions
44 lines (35 loc) · 1.27 KB
/
TestSmartyPants.cs
File metadata and controls
44 lines (35 loc) · 1.27 KB
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
using Markdig.Extensions.SmartyPants;
namespace Markdig.Tests;
public class TestSmartyPants
{
[Test]
public void MappingCanBeReconfigured()
{
var options = new SmartyPantOptions();
options.Mapping[SmartyPantType.LeftAngleQuote] = "foo";
options.Mapping[SmartyPantType.RightAngleQuote] = "bar";
var pipeline = new MarkdownPipelineBuilder()
.UseSmartyPants(options)
.Build();
TestParser.TestSpec("<<test>>", "<p>footestbar</p>", pipeline);
}
[Test]
public void MappingCanBeReconfigured_HandlesRemovedMappings()
{
var options = new SmartyPantOptions();
options.Mapping.Remove(SmartyPantType.LeftAngleQuote);
options.Mapping.Remove(SmartyPantType.RightAngleQuote);
var pipeline = new MarkdownPipelineBuilder()
.UseSmartyPants(options)
.Build();
TestParser.TestSpec("<<test>>", "<p>«test»</p>", pipeline);
}
[Test]
public void RecognizesSupplementaryCharacters()
{
var pipeline = new MarkdownPipelineBuilder()
.UseSmartyPants()
.Build();
TestParser.TestSpec("\"𝜵\"𠮷\"𝜵\"𩸽\"", "<p>"𝜵“𠮷”𝜵“𩸽”</p>", pipeline);
}
}