Merge pull request #652 from Demonthos/fix-fmt-escape

fix fmt escape sequences in static attribute/text nodes
This commit is contained in:
Jon Kelley 2022-12-10 13:07:26 -08:00 committed by GitHub
commit 1e50bc8c99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,7 +182,7 @@ impl<'a> DynamicContext<'a> {
let static_attrs = el.attributes.iter().map(|attr| match &attr.attr {
ElementAttr::AttrText { name, value } if value.is_static() => {
let value = value.source.as_ref().unwrap();
let value = value.to_static().unwrap();
quote! {
::dioxus::core::TemplateAttribute::Static {
name: dioxus_elements::#el_name::#name.0,
@ -196,7 +196,7 @@ impl<'a> DynamicContext<'a> {
}
ElementAttr::CustomAttrText { name, value } if value.is_static() => {
let value = value.source.as_ref().unwrap();
let value = value.to_static().unwrap();
quote! {
::dioxus::core::TemplateAttribute::Static {
name: #name,
@ -244,7 +244,7 @@ impl<'a> DynamicContext<'a> {
}
BodyNode::Text(text) if text.is_static() => {
let text = text.source.as_ref().unwrap();
let text = text.to_static().unwrap();
quote! { ::dioxus::core::TemplateNode::Text{ text: #text } }
}