h2md 0.1.0

HTML to Markdown converter powered by a browser-grade HTML parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use h2md::convert;

fn main() {
    let open_tags = "<div>".repeat(150);
    let close_tags = "</div>".repeat(150);
    let html = format!("{}<p>content</p>{}", open_tags, close_tags);
    let mut out = Vec::new();
    let result = convert(html.as_bytes(), &mut out);
    println!("Result: {:?}", result);
    if result.is_ok() {
        println!("Output length: {}", out.len());
        let md = String::from_utf8_lossy(&out);
        println!("First 200 chars: {}", &md[..md.len().min(200)]);
    }
}