lithtml 0.8.0

A lightweight and fast HTML parser for Rust, designed to handle both full HTML documents and fragments efficiently.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use indoc::indoc;
use insta::assert_debug_snapshot;
use lithtml::{Dom, Result};

#[test]
fn it_can_generate_source_span() -> Result<()> {
    let html = indoc! {"
            <template>
                <h1>Header</h1>
                <p>Paragraph</p>
            </template>
        "};
    let dom = Dom::parse(html)?;
    assert_debug_snapshot!(dom);
    Ok(())
}