parse_fragment

Function parse_fragment 

Source
pub fn parse_fragment(html: &str) -> Vec<Node>
Expand description

Parse an HTML fragment string into a list of nodes.

This is useful for parsing partial HTML content like template snippets.

ยงExample

use ironhtml_parser::{parse_fragment, NodeType};

let nodes = parse_fragment("<div><span>Hello</span></div>");
assert_eq!(nodes.len(), 1);
assert_eq!(nodes[0].node_type(), NodeType::Element);