tagsoup 0.1.0

Fun html-like tag soup parser with zero dependencies.
Documentation

TagSoup

MIT License crates.io docs.rs Build status

TagSoup is a simple HTML parser written in Rust.

It is however, very fast.

It attempts to parse HTML tag soup as best as it can. It is not a full HTML parser, but it should be able to handle most HTML documents.

Loosly based on HTML Living Standard.

Usage

// Parse an HTML fragment.
let doc = tagsoup::Document::parse("<div><p id=here>Hello, world!</p></div>");

// Check for parsing errors.
assert!(doc.errors.is_empty());

// Query the document for an element using a CSS selector.
let element = doc.query_selector("#here").unwrap();
assert_eq!(element.text_content(), "Hello, world!");

📜 License

Licensed under MIT License, see license.txt.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.