html_parser_rscx 0.7.1

A simple and general purpose html/xhtml parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use html_parser::{Dom, Result};
use indoc::indoc;
use insta::assert_debug_snapshot;

#[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(())
}