Crates.io | fast_html2md |
lib.rs | fast_html2md |
version | 0.0.21 |
source | src |
created_at | 2023-12-28 17:03:50.262796 |
updated_at | 2024-11-01 18:15:18.572012 |
description | A fast html2md crate for rust |
homepage | |
repository | https://github.com/spider-rs/html2md |
max_upload_size | |
id | 1082532 |
size | 435,973 |
A Rust html to markdown crate built for performance.
cargo add fast_html2md
use html2md::parse_html;
let md = parse_html("<p>JAMES</p>", false);
assert_eq!(md, "JAMES")
let mut tag_factory: HashMap<String, Box<dyn html2md::TagHandlerFactory>> =
HashMap::new();
let tag = Box::new(IgnoreTagFactory {});
tag_factory.insert(String::from("script"), tag.clone());
tag_factory.insert(String::from("style"), tag.clone());
tag_factory.insert(String::from("noscript"), tag.clone());
let html = html2md::parse_html_custom(&html, &tag_factory, false);
This project is a practical rewrite from the original html2md
with major bug fixes and performance improvements.