diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-30 18:32:30 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-12-05 02:52:36 +0100 |
commit | 76408590349f7f132c1dfeb9db3fb1dea964227c (patch) | |
tree | 2e88df0b737ec3225937630c758502400753f87b /tests/test_html5lib.rs | |
parent | c29558e8d165df1d3fc1cb32079da9e40f957dc6 (diff) |
spans: support attribute names
Diffstat (limited to 'tests/test_html5lib.rs')
-rw-r--r-- | tests/test_html5lib.rs | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/tests/test_html5lib.rs b/tests/test_html5lib.rs index 5668217..662f3c5 100644 --- a/tests/test_html5lib.rs +++ b/tests/test_html5lib.rs @@ -1,5 +1,5 @@ use html5gum::{ - Doctype, EndTag, Error, InternalState as State, Reader, StartTag, Token, Tokenizer, + Attribute, Doctype, EndTag, Error, InternalState as State, Reader, StartTag, Token, Tokenizer, }; use pretty_assertions::assert_eq; use serde::{de::Error as _, Deserialize}; @@ -79,14 +79,36 @@ impl<'de> Deserialize<'de> for ExpectedOutputTokens { OutputToken::StartTag(_, name, attributes) => Token::StartTag(StartTag { self_closing: false, name, - attributes, + attributes: attributes + .into_iter() + .map(|(k, v)| { + ( + k, + Attribute { + value: v, + ..Default::default() + }, + ) + }) + .collect(), name_span: (), }), OutputToken::StartTag2(_, name, attributes, self_closing) => { Token::StartTag(StartTag { self_closing, name, - attributes, + attributes: attributes + .into_iter() + .map(|(k, v)| { + ( + k, + Attribute { + value: v, + ..Default::default() + }, + ) + }) + .collect(), name_span: (), }) } |