html.rs 589 B

123456789101112131415161718192021222324
  1. use html_parser::Dom;
  2. fn main() {
  3. let html = r#"
  4. <div>
  5. <div class="asd">hello world!</div>
  6. <div id="asd">hello world!</div>
  7. <div id="asd">hello world!</div>
  8. <div for="asd">hello world!</div>
  9. <div async="asd">hello world!</div>
  10. <div LargeThing="asd">hello world!</div>
  11. <ai-is-awesome>hello world!</ai-is-awesome>
  12. </div>
  13. "#
  14. .trim();
  15. let dom = Dom::parse(html).unwrap();
  16. let body = rsx_rosetta::rsx_from_html(&dom);
  17. let out = dioxus_autofmt::write_block_out(body).unwrap();
  18. println!("{out}");
  19. }