aboutsummaryrefslogtreecommitdiff
path: root/tests/test_spans.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_spans.rs')
-rw-r--r--tests/test_spans.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index d3e62ae..bc6aeee 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -132,6 +132,22 @@ fn attribute_value_span() {
}
#[test]
+fn attribute_value_with_char_ref() {
+ let html = "<test x=&amp; y='&amp;' z=\"&amp;\">";
+ let mut labels = Vec::new();
+ let Token::StartTag(tag) = tokenizer(html).next().unwrap() else {
+ panic!("expected start tag")
+ };
+ for attr in &tag.attributes {
+ labels.push((attr.value_span().unwrap(), ""));
+ }
+ assert_snapshot!(annotate(html, labels), @r###"
+ <test x=&amp; y='&amp;' z="&amp;">
+ ^ ^ ^
+ "###);
+}
+
+#[test]
fn comment_proper_data_span() {
let html = "<!-- Why are you looking at the source code? -->";
let Token::Comment(comment) = tokenizer(html).next().unwrap() else {