Streamline HTML element API (#66) There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `<strong><em>…</em></strong>` or `<h1>Something <em>something</em> something</h1>`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content. This also means that all elements now have the same API.
1 file changed, 1 insertion(+), 1 deletion(-)
changed files
M examples/simple/simple.go → examples/simple/simple.go
@@ -42,7 +42,7 @@ Navbar(p.path, []PageLink{ {Path: "/foo", Name: "Foo"}, {Path: "/bar", Name: "Bar"}, }), - H1(p.title), + H1(g.Text(p.title)), P(g.Textf("Welcome to the page at %v.", p.path)), }, })