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
2017-09-01 21:49:39 +01:00

13 lines
456 B
Rust

use renderers::{sciter_start, get_html};
use config::Config;
pub fn html_cleanup(config: Config, input: String) -> Result<String, String> {
let mut root = sciter_start(input);
root.find_first("meta[content='text/css']").unwrap().unwrap().destroy().unwrap();
root.find_first("style").unwrap().unwrap().destroy().unwrap();
root.find_first("title").unwrap().unwrap().destroy().unwrap();
let html = get_html(root);
return Ok(html);
}