summary refs log tree commit diff
diff options
context:
space:
mode:
authortempest <git@ashen.earth>2025-06-17 00:13:27 -0600
committertempest <git@ashen.earth>2025-06-17 00:13:27 -0600
commit6364b044811beee2c63445c5ace7b9d6bf63f16e (patch)
tree79017008da12365be50c47062c9c7c3914cb7bf8
parent289ebcf15b99637ad3647276f0dc7ec602501b4c (diff)
Allow attributes to have -
-rw-r--r--src/render.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/render.rs b/src/render.rs
index 7edcd9e..73e1a5e 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -62,9 +62,14 @@ impl RenderNode {
             },
 
             RenderNode::Element { name, attributes, children } => {
-                let text_attributes = attributes.into_iter()
-                    .map(|(key, value)| format!(" {key}=\"{value}\""))
-                    .collect::<Vec<_>>().join("");
+                let text_attributes = attributes
+                    .into_iter()
+                    .map(|(key, value)| {
+                        let corrected_key = key.replace("_", "-");
+                        format!(" {corrected_key}=\"{value}\"")
+                    })
+                    .collect::<Vec<_>>()
+                    .join("");
 
                 Box::pin(async move {
                     let rendered_children = join_all(children.into_iter()