Skip to content

Commit

Permalink
chore(minor): fix element classes map format
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Feb 25, 2023
1 parent b7955b9 commit c3dd260
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,16 @@ impl Element {
let classes: HashSet<LocalName> = attrs
.iter()
.find(|a| a.name.local.deref() == "class")
.map_or_else(|| HashSet::new(), |a| {
a.value
.deref()
.split_whitespace()
.map(LocalName::from)
.collect()
});
.map_or_else(
|| HashSet::new(),
|a| {
a.value
.deref()
.split_whitespace()
.map(LocalName::from)
.collect()
},
);

Element {
attrs: attrs.into_iter().map(|a| (a.name, a.value)).collect(),
Expand Down

0 comments on commit c3dd260

Please sign in to comment.