htmd 0.5.4

A turndown.js inspired HTML to Markdown converter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Shared code for all integration tests.
use htmd::{
    HtmlToMarkdown,
    options::{Options, TranslationMode},
};

// By default, use the faithful translation mode, which is more stringent.
pub fn convert(html: &str) -> std::io::Result<String> {
    HtmlToMarkdown::builder()
        .options(Options {
            translation_mode: TranslationMode::Faithful,
            ..Default::default()
        })
        .build()
        .convert(html)
}