Table of Contents

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

html string

The HTML content to convert.

options HtmlToMarkdownOptions

Optional 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 html is null.

Share