node-html-parser 0.1.1

Fast HTML parser for Rust & WASM producing a lightweight DOM with CSS selector querying.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use node_html_parser::parse;

#[test]
fn issue_48_decoded_text_numeric_entity() {
	let root = parse("<div>The king&#39;s hat is on fire!</div>");
	let div = root.query_selector("div").unwrap();
	assert_eq!(div.text(), "The king's hat is on fire!");
}

#[test]
fn issue_48_decoded_text_named_entity() {
	let root = parse("<div>The king&apos;s hat is on fire!</div>");
	let div = root.query_selector("div").unwrap();
	assert_eq!(div.text(), "The king's hat is on fire!");
}