From 6763f3564a4640130e297c1f775e2c77f03dae89 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 31 Aug 2023 04:36:59 +0200 Subject: test: verify wrong attribute value spans for char refs --- tests/test_spans.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') 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 @@ -131,6 +131,22 @@ fn attribute_value_span() { "###); } +#[test] +fn attribute_value_with_char_ref() { + let html = ""; + 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] fn comment_proper_data_span() { let html = ""; -- cgit v1.2.3