summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 2683a6d..740d857 100644
--- a/README.md
+++ b/README.md
@@ -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