-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathMarkdownToXmlConverter.cs
More file actions
50 lines (45 loc) · 1.04 KB
/
MarkdownToXmlConverter.cs
File metadata and controls
50 lines (45 loc) · 1.04 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
45
46
47
48
49
50
using Waher.Runtime.Inventory;
using System.Threading.Tasks;
using Waher.Content.Markdown.Xml;
namespace Waher.Content.Markdown.Web
{
/// <summary>
/// Converts Markdown documents to XML documents.
/// </summary>
public class MarkdownToXmlConverter : MarkdownToHtmlConverter
{
/// <summary>
/// Converts Markdown documents to XML documents.
/// </summary>
public MarkdownToXmlConverter()
{
}
/// <summary>
/// Converts content to these content types.
/// </summary>
public override string[] ToContentTypes
{
get
{
return new string[]
{
"text/xml",
"application/xml"
};
}
}
/// <summary>
/// How well the content is converted.
/// </summary>
public override Grade ConversionGrade => Grade.Ok;
/// <summary>
/// Performs the actual conversion
/// </summary>
/// <param name="Doc">Markdown document prepared for conversion.</param>
/// <returns>Conversion result.</returns>
protected override Task<string> DoConversion(MarkdownDocument Doc)
{
return Doc.ExportXml();
}
}
}