(macros): Evita duplicar splices de attr en html!

This commit is contained in:
Manuel Cillero 2026-08-16 17:03:08 +02:00
parent ed30b2ae17
commit 05187c9343

View file

@ -206,6 +206,7 @@ impl DiagnosticParse for Element {
},
attrs: {
let mut id_pushed = false;
let mut splice_pushed = false;
let mut attrs = Vec::new();
while input.peek(Ident::peek_any)
@ -226,6 +227,16 @@ impl DiagnosticParse for Element {
id_pushed = true;
}
if let Attribute::Splice { .. } = attr {
if splice_pushed {
return Err(Error::new_spanned(
attr,
"only one spliced attribute value is allowed per element",
));
}
splice_pushed = true;
}
attrs.push(attr);
}