This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf-rs/src/renderers/html_cleanup.rs

13 lines
399 B
Rust
Raw Normal View History

2017-09-01 22:37:54 +01:00
use renderers::{sciter_start, get_html, destroy_matching};
use config::Config;
pub fn html_cleanup(config: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
2017-09-01 22:37:54 +01:00
destroy_matching(&mut root, "meta[content='text/css']");
destroy_matching(&mut root, "style");
destroy_matching(&mut root, "title");
let html = get_html(root);
return Ok(html);
}