htmlproc 0.3.3

HTML processors as utils written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::omit_enclosure::manipulate;

pub fn reset_document_outline(output: &str, html: &str) -> String {
    let mut omit_tags = Vec::<&str>::new();
    // omits document outline tags if necessary
    if !html.contains("<html>") {
        omit_tags.push("html")
    };
    if !html.contains("<head>") {
        omit_tags.push("head")
    };
    if !html.contains("<body>") {
        omit_tags.push("body")
    };
    let omit_tags = omit_tags.as_slice();
    manipulate(output, omit_tags)
}