fix: parsing of attributes without trailing commas
This commit is contained in:
1 parent
6fd5ac38bb
commit
d160f38bc2
2 files changed
+7
-2
No files matched your search
@@ -67,6 +67,12 @@ fn app(cx: Scope) -> Element {
|
||||
stroke: "blue",
|
||||
stroke_width: "5",
|
||||
}
|
||||
path {
|
||||
d: "M9.00001 9C9 62 103.5 124 103.5 178",
|
||||
stroke: "#3CC4DC",
|
||||
"stroke-linecap": "square",
|
||||
"stroke-width": "square",
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ impl Parse for Element {
|
||||
|
||||
content.parse::<Token![:]>()?;
|
||||
|
||||
if content.peek(LitStr) && content.peek2(Token![,]) {
|
||||
if content.peek(LitStr) {
|
||||
let value = content.parse()?;
|
||||
attributes.push(ElementAttrNamed {
|
||||
el_name: el_name.clone(),
|
||||
@@ -53,7 +53,6 @@ impl Parse for Element {
|
||||
});
|
||||
} else {
|
||||
let value = content.parse::<Expr>()?;
|
||||
|
||||
attributes.push(ElementAttrNamed {
|
||||
el_name: el_name.clone(),
|
||||
attr: ElementAttr::CustomAttrExpression { name, value },
|
||||
|
||||
Reference in new issue
Block a user