Expand description
Fast HTML to Markdown conversion with GFM support.
§Features
- Headings:
<h1>-<h6>->#-###### - Emphasis:
<strong>/<b>->**bold**,<em>/<i>->*italic* - Strikethrough:
<del>/<s>->~~struck~~ - Lists:
<ul>/<ol>with proper nesting and indentation - Links:
<a href="">->[text](url) - Images:
<img>-> - Code:
<code>->`inline`,<pre><code>-> fenced blocks with language - Tables: Full GFM table support with alignment
- Blockquotes:
<blockquote>->> quote
§Quick Start
use quick_html2md::html_to_markdown;
let html = "<h1>Hello</h1><p>World</p>";
let md = html_to_markdown(html);
assert!(md.contains("# Hello"));
assert!(md.contains("World"));§With Options
use quick_html2md::{html_to_markdown_with_options, MarkdownOptions};
let options = MarkdownOptions::new()
.include_links(false)
.preserve_tables(true);
let html = "<p><a href='url'>link</a></p>";
let md = html_to_markdown_with_options(html, &options);Re-exports§
pub use options::MarkdownOptions;
Modules§
- options
- Configuration for Markdown output.
Functions§
- element_
to_ markdown - Convert HTML element to Markdown.
- element_
to_ markdown_ with_ options - Convert HTML element to Markdown with options.
- html_
to_ markdown - Convert HTML string to Markdown.
- html_
to_ markdown_ with_ options - Convert HTML string to Markdown with options.
- to_
markdown - Convert HTML document to Markdown.
- to_
markdown_ with_ options - Convert HTML document to Markdown with options.