pub fn parse(source: String) -> dom::Node {
    let mut nodes = Parser { pos: 0, input: source }.parse_nodes();

    // If the document contains a root element, just return it. Otherwise, create one.
    if nodes.len() == 1 {
        nodes.swap_remove(0)
    } else {
        dom::elem("html".to_string(), HashMap::new(), nodes)
    }
}
/// Parse an HTML document and return the root element.
Parse an HTML document and return the root element.
Parse an HTML document and return the root element .
pub fn parse(source: String) -> dom::Node {
    let mut nodes = Parser { pos: 0, input: source }.parse_nodes();
    // If the document contains a root element, just return it. Otherwise, create one.
    if nodes.len() == 1 {
        nodes.swap_remove(0)
    } else {
        dom::elem("html".to_string(), HashMap::new(), nodes)
    }
}
pub fn parse ( source : String ) -> dom :: Node { let mut nodes = Parser { pos : 0 , input : source } . parse_nodes ( ) ; // If the document contains a root element, just return it. Otherwise, create one. if nodes . len ( ) == 1 { nodes . swap_remove ( 0 ) } else { dom :: elem ( " " . to_string ( ) , HashMap :: new ( ) , nodes ) } }
Parse an HTML document and return the root element.
Parse an HTML document and return the root element .
source
String