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
465 B
Rust
Raw Normal View History

use renderers::helpers::{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);
}