From fd360bb6b9848aa4005f54cc8a2d0cb8ad5cf2df Mon Sep 17 00:00:00 2001 From: Antonio Pitasi Date: Sat, 9 Sep 2023 20:01:05 +0200 Subject: [PATCH] fix "as" html attributes not being rendered --- rscx-macros/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rscx-macros/src/lib.rs b/rscx-macros/src/lib.rs index e8f7917..dc49102 100644 --- a/rscx-macros/src/lib.rs +++ b/rscx-macros/src/lib.rs @@ -148,7 +148,11 @@ fn walk_nodes<'a>(empty_elements: &HashSet<&str>, nodes: &'a Vec) -> WalkN out.values.push(block.to_token_stream()); } NodeAttribute::Attribute(attribute) => { - out.static_format.push_str(&format!(" {}", attribute.key)); + let key = match attribute.key.to_string().as_str() { + "as_" => "as".to_string(), + _ => attribute.key.to_string(), + }; + out.static_format.push_str(&format!(" {}", key)); if let Some(value) = attribute.value() { out.static_format.push_str(r#"="{}""#); out.values.push(value.to_token_stream());