Set body class
This commit is contained in:
parent
1132c78234
commit
a6d6185f9f
1 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
use html::{sciter_start, get_html, destroy_matching, destroy_at, get_head};
|
use html::{sciter_start, get_html, destroy_matching, destroy_at, get_head, get_body};
|
||||||
use sciter::Element;
|
use sciter::Element;
|
||||||
use config::Config;
|
use config::Config;
|
||||||
|
|
||||||
|
@ -9,7 +9,12 @@ pub fn head_cleanup(config: Config, input: String) -> Result<String, String> {
|
||||||
destroy_matching(&mut head, "meta[content='text/css']");
|
destroy_matching(&mut head, "meta[content='text/css']");
|
||||||
destroy_matching(&mut head, "style");
|
destroy_matching(&mut head, "style");
|
||||||
destroy_matching(&mut head, "title");
|
destroy_matching(&mut head, "title");
|
||||||
|
|
||||||
let mut meta_charset = Element::create_at("meta", &mut head).unwrap();
|
let mut meta_charset = Element::create_at("meta", &mut head).unwrap();
|
||||||
meta_charset.set_attribute("charset", "UTF-8");
|
meta_charset.set_attribute("charset", "UTF-8");
|
||||||
|
|
||||||
|
let mut body = get_body(&mut root);
|
||||||
|
body.set_attribute("class", "content").expect("Failed to set body class");
|
||||||
|
|
||||||
return Ok(get_html(root));
|
return Ok(get_html(root));
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue