diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -32,6 +32,22 @@ for token in NaiveParser::new(html).flatten() { assert_eq!(new_html, "<title>hello world</title>"); ``` +This library can provide source spans. For an example, see +[`examples/spans.rs`], which produces the following output: + +```output id=spans +note: + ┌─ file.html:1:2 + │ +1 │ <img src=example.jpg alt="some description"> + │ ^^^ ^^^ ^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^ attr value + │ │ │ │ │ + │ │ │ │ attr name + │ │ │ attr value + │ │ attr name + │ tag name +``` + ## Limitations * This crate does not yet implement tree construction @@ -63,6 +79,7 @@ Licensed under the MIT license, see [the LICENSE file]. [parsing model]: https://html.spec.whatwg.org/multipage/parsing.html#overview-of-the-parsing-model +[`examples/spans.rs`]: ./examples/spans.rs [character encoding detection]: https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding [html5lib tokenizer test suite]: https://github.com/html5lib/html5lib-tests/tree/master/tokenizer [html5gum]: https://crates.io/crates/html5gum |