1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! HTML-to-AST parser for converting HTML back to Markdown.
//!
//! This module provides functionality to parse HTML and convert it back to the
//! same [`Block`](crate::Block) AST used by the Markdown parser, enabling
//! HTML-to-Markdown conversion.
//!
//! # Examples
//!
//! ```
//! use ironmark::{parse_html_to_ast, html_to_markdown, HtmlParseOptions, Block};
//!
//! // Parse HTML to AST
//! let ast = parse_html_to_ast("<h1>Hello</h1><p>World</p>", &HtmlParseOptions::default());
//!
//! // Convert HTML directly to Markdown
//! let md = html_to_markdown("<p><strong>Bold</strong> text</p>", &HtmlParseOptions::default());
//! assert!(md.contains("**Bold**"));
//! ```
pub use ;
use craterender_markdown;
/// Parse HTML and render directly to Markdown.
///
/// This is a convenience function combining [`parse_html_to_ast`] and
/// [`render_markdown`](crate::render_markdown).
///
/// # Examples
///
/// ```
/// use ironmark::{html_to_markdown, HtmlParseOptions};
///
/// let md = html_to_markdown(
/// "<p><strong>Bold</strong> and <em>italic</em></p>",
/// &HtmlParseOptions::default()
/// );
/// assert_eq!(md.trim(), "**Bold** and *italic*");
/// ```