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/processors/rebrand.rs

12 lines
413 B
Rust
Raw Normal View History

2017-09-06 20:07:06 +01:00
use html::{sciter_start, get_html, get_head, find_first};
use config::Config;
2017-11-21 22:17:35 +00:00
pub fn rebrand(_: Config, input: String) -> Result<String, String> {
2017-09-06 20:07:06 +01:00
let mut root = sciter_start(input);
let mut head = get_head(&mut root);
2017-09-09 18:02:03 +01:00
let mut ele = find_first(&mut head, "meta[name='generator']");
ele.set_attribute("content", crate_name!()).expect("Failed to set generator.");
2017-09-06 20:07:06 +01:00
return Ok(get_html(root));
}