From 20076b120a04e55e3ca13dbd86bec48874cfe8b1 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Sat, 21 Oct 2023 17:19:34 +0200 Subject: [PATCH] feat: support namespaced attributes --- src/transpiling/jsx_string.rs | 55 +++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/src/transpiling/jsx_string.rs b/src/transpiling/jsx_string.rs index 34a26cb..8effff9 100644 --- a/src/transpiling/jsx_string.rs +++ b/src/transpiling/jsx_string.rs @@ -44,6 +44,7 @@ fn normalize_dom_attr_name(name: &str) -> String { "className" => "class".to_string(), // xlink:href was removed from SVG and isn't needed "xlinkHref" => "href".to_string(), + "xlink:href" => "href".to_string(), _ => name.to_string(), } } @@ -80,10 +81,12 @@ fn get_attr_name(jsx_attr: &JSXAttr) -> String { match &jsx_attr.name { // Case: