You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReverseMarkdown is a Html to Markdown (http://daringfireball.net/projects/markdown/syntax) converter library in C#. Conversion is very reliable since HtmlAgilityPack (HAP) library is used for traversing the Html DOM.
13
6
14
-
Note that the library implementation is based on the Ruby based Html to Markdown converter [ xijo/reverse_markdown](https://github.com/xijo/reverse_markdown).
15
-
16
7
## Usage
17
8
18
9
Install the package from NuGet using `Install-Package ReverseMarkdown` or clone the repository and built it yourself.
@@ -81,7 +72,7 @@ var converter = new ReverseMarkdown.Converter(config);
81
72
*`UnknownTagsOption.Raise` - Raise an error to let you know
82
73
*`WhitelistUriSchemes` - Specify which schemes (without trailing colon) are to be allowed for `<a>` and `<img>` tags. Others will be bypassed (output text or nothing). By default allows everything.
83
74
84
-
If `string.Empty` provided and when `href` or `src` schema coudn't be determined - whitelists
75
+
If `string.Empty` provided and when `href` or `src` schema couldn't be determined - whitelists
85
76
86
77
Schema is determined by `Uri` class, with exception when url begins with `/` (file schema) and `//` (http schema)
87
78
*`TableWithoutHeaderRowHandling` - handle table without header rows
@@ -96,6 +87,9 @@ var converter = new ReverseMarkdown.Converter(config);
96
87
* Can deal with nested lists
97
88
* Github Flavoured Markdown conversion supported for br, pre and table. Use `var config = new ReverseMarkdown.Config(githubFlavoured:true);`. By default table will always be converted to Github flavored markdown immaterial of this flag.
98
89
90
+
## Acknowledgement
91
+
The library implementation is based on the Ruby based Html to Markdown converter [xijo/reverse_markdown](https://github.com/xijo/reverse_markdown).
<sup><ahref='/src/ReverseMarkdown.Test/Snippets.cs#L28-L44'title='Snippet source file'>snippet source</a> | <ahref='#snippet-usagewithconfig'title='Start of snippet'>anchor</a></sup>
55
+
<!-- endSnippet -->
22
56
23
57
## Configuration options
24
58
@@ -38,10 +72,11 @@ snippet: UsageWithConfig
38
72
*`UnknownTagsOption.Drop` - Drop the unknown tag and its content
39
73
*`UnknownTagsOption.Bypass` - Ignore the unknown tag but try to convert its content
40
74
*`UnknownTagsOption.Raise` - Raise an error to let you know
75
+
*`PassThroughTags` - Pass a list of tags to pass through as-is without any processing.
41
76
*`WhitelistUriSchemes` - Specify which schemes (without trailing colon) are to be allowed for `<a>` and `<img>` tags. Others will be bypassed (output text or nothing). By default allows everything.
42
77
43
-
If `string.Empty` provided and when `href` or `src` schema coudn't be determined - whitelists
44
-
78
+
If `string.Empty` provided and when `href` or `src` schema couldn't be determined - whitelists
79
+
45
80
Schema is determined by `Uri` class, with exception when url begins with `/` (file schema) and `//` (http schema)
46
81
*`TableWithoutHeaderRowHandling` - handle table without header rows
47
82
*`TableWithoutHeaderRowHandlingOption.Default` - First row will be used as header row (default)
0 commit comments