From 3b7dceab897709fe8243c605adea90ee771c49ff Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Wed, 5 May 2021 09:03:16 +0200 Subject: 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 `` or `

Something something something

`. 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.--- components/documents.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components') diff --git a/components/documents.go b/components/documents.go index b9ab085..c7d8f8d 100644 --- a/components/documents.go +++ b/components/documents.go @@ -23,7 +23,7 @@ func HTML5(p HTML5Props) g.Node { Head( Meta(Charset("utf-8")), Meta(Name("viewport"), Content("width=device-width, initial-scale=1")), - TitleEl(p.Title), + TitleEl(g.Text(p.Title)), g.If(p.Description != "", Meta(Name("description"), Content(p.Description))), g.Group(p.Head), ), -- cgit 1.4.1