astral-html
A high-performance HTML parser designed for document traversal.
[!WARNING]
This README was written by a human, but all code changes, PR summaries, and additional documentation were authored entirely by GPT-6 Astra in Codex.
Example usage
Use Document to traverse elements and extract text and attributes, or Reader
to process HTML as a stream of tokens.
For example, to extract links from a document:
use Document;
let source = r#"<a href="/guide">Read the guide</a>"#;
let document = parse?;
for element in document.elements.filter
To extract link URLs without building a document, use Reader:
use ;
let source = r#"<a href="/guide">Read the guide</a>"#;
for token in new
License
astral-html is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in astral-html by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.