From 8015b11da8b1237515d1d4ec57acd2ff3df4bb23 Mon Sep 17 00:00:00 2001 From: Bram Hoendervangers Date: Wed, 10 Jul 2024 18:06:17 +0200 Subject: [PATCH] feat: support elements with generics (#128) --- formatter/src/formatter/element.rs | 7 +++++++ prettyplease | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/formatter/src/formatter/element.rs b/formatter/src/formatter/element.rs index 84fe88e..af11157 100644 --- a/formatter/src/formatter/element.rs +++ b/formatter/src/formatter/element.rs @@ -19,6 +19,7 @@ impl Formatter<'_> { fn opening_tag(&mut self, element: &NodeElement, is_void: bool) { self.printer.word("<"); self.node_name(&element.open_tag.name); + leptosfmt_prettyplease::unparse_generics(&element.open_tag.generics, self.printer); self.attributes(element.attributes()); @@ -409,4 +410,10 @@ mod tests { "#); } + + #[test] + fn with_generics() { + let formatted = format_element! { /> }; + insta::assert_snapshot!(formatted, @"/>"); + } } diff --git a/prettyplease b/prettyplease index 7daec66..f9800e0 160000 --- a/prettyplease +++ b/prettyplease @@ -1 +1 @@ -Subproject commit 7daec664f263b1c5963917b532f8a70eae902869 +Subproject commit f9800e0878bb2ec6433fd81862ca6b432ea718c2