Hyphenated attributes throw "error: expected `=`"
niallrr opened this issue · comments
Niall commented
Hyphenated attributes produce the following error. This is important for being able to use Bootstrap.
button [
type="button",
class="btn btn-circle btn-dual-secondary d-lg-none align-v-r",
data-toggle="layout",
data-action="sidebar_close"
]
{
i [class="fa fa-times text-danger"]
}
Throws the error
error: expected `=`
--> src/t_base.rs:115:29
|
115 | data-toggle="layout",
|
Niall commented
Just found a workaround
"data-toggle"="layout",
"data-action"="sidebar_close"
Utkarsh Kukreti commented
Hi, yes, that's the right way. Proc macros in Rust work with Rust tokens, so there's no way to distinguish between data - toggle = "layout"
and data-toggle = "layout"
, which is why I allow string literals on the left of =
.
Sven commented
@utkarshkukreti Is there a similar way to output a hyphenated element?
my-custom-element#id.class {
@content
}
Currently gives error expected expression
pointing at the @content
. This is important for custom elements.