Fix elements and attributes mapping for dx translate

This commit is contained in:
Evan Almloff committed 2024-01-03 15:18:27 -06:00
1 parent 2e424436b3
commit afb258b658
10 files changed
+202 -17

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
use html_parser::Dom;
#[test]
fn raw_attribute() {
let html = r#"
<div>
<div unrecognizedattribute="asd">hello world!</div>
</div>
"#
.trim();
let dom = Dom::parse(html).unwrap();
let body = rsx_rosetta::rsx_from_html(&dom);
let out = dioxus_autofmt::write_block_out(body).unwrap();
let expected = r#"
div { div { "unrecognizedattribute": "asd", "hello world!" } }"#;
pretty_assertions::assert_eq!(&out, &expected);
}