2024-01-03 15:18:27 -06:00
|
|
|
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();
|
|
|
|
|
2024-09-16 16:04:20 -07:00
|
|
|
let body = dioxus_rsx_rosetta::rsx_from_html(&dom);
|
2024-01-03 15:18:27 -06:00
|
|
|
|
2024-07-02 12:27:11 -07:00
|
|
|
let out = dioxus_autofmt::write_block_out(&body).unwrap();
|
2024-01-03 15:18:27 -06:00
|
|
|
|
|
|
|
let expected = r#"
|
2024-04-03 15:27:36 -07:00
|
|
|
div {
|
|
|
|
div { "unrecognizedattribute": "asd", "hello world!" }
|
|
|
|
}"#;
|
2024-01-03 15:18:27 -06:00
|
|
|
pretty_assertions::assert_eq!(&out, &expected);
|
|
|
|
}
|