Skip to main content

parse

Function parse 

Source
pub fn parse(input: &str) -> Box<HTMLElement>
Expand description

Parse HTML string with default options.

This is the main entry point for parsing HTML. It uses sensible defaults and returns the root element containing the parsed DOM tree.

§Arguments

  • input - The HTML string to parse

§Returns

A boxed HTMLElement representing the root of the parsed DOM tree

§Examples

use node_html_parser::parse;

let root = parse("<div>Hello world</div>");
assert_eq!(root.children.len(), 1);