Class MarkdownHelper
- Namespace
- SunamoMarkdown
- Assembly
- SunamoMarkdown.dll
Helper class for converting HTML to Markdown format.
public class MarkdownHelper
- Inheritance
-
MarkdownHelper
- Inherited Members
- Extension Methods
Methods
ConvertToMarkDown(string)
Converts HTML to Markdown format. Uses Html2Markdown which has dependency HtmlAgilityPack 1.5. Therefore I can't replace with standard 1.11.2 and can't compile these projects. Therefore commented and removed nuget package.
public static string ConvertToMarkDown(string html)
Parameters
htmlstringThe HTML string to convert.
Returns
- string
The converted Markdown string.
ReplacePairTag(string, string, string)
Replaces opening and closing HTML tags with specified replacement string.
public static string ReplacePairTag(string text, string tag, string replacement)
Parameters
textstringThe text containing HTML tags.
tagstringThe HTML tag name to replace (without angle brackets).
replacementstringThe string to replace the tags with.
Returns
- string
The string with replaced tags.