Method Convert
- Namespace
- LMKit.Document.Conversion
- Assembly
- LM-Kit.NET.dll
Convert(string, HtmlToMarkdownOptions)
Converts HTML to Markdown.
public static string Convert(string html, HtmlToMarkdownOptions options = null)
Parameters
htmlstringThe HTML content to convert.
optionsHtmlToMarkdownOptionsOptional conversion options to customize the output.
Returns
- string
The converted Markdown string.
Examples
using LMKit.Document.Conversion;
string html = "<h1>Title</h1><p>Hello <strong>world</strong>.</p>";
string markdown = HtmlToMarkdown.Convert(html);
// markdown is similar to:
// # Title
//
// Hello **world**.
Exceptions
- ArgumentNullException
Thrown when
htmlisnull.