Skip to content

Commit

Permalink
feat: support elements with generics (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
bram209 authored Jul 10, 2024
1 parent 90cf8ea commit 8015b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions formatter/src/formatter/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -409,4 +410,10 @@ mod tests {
</div>
"#);
}

#[test]
fn with_generics() {
let formatted = format_element! { <SizeOf<String>/> };
insta::assert_snapshot!(formatted, @"<SizeOf<String>/>");
}
}
2 changes: 1 addition & 1 deletion prettyplease
Submodule prettyplease updated 1 files
+8 −3 src/lib.rs

0 comments on commit 8015b11

Please sign in to comment.