From 05d56605492cb89bebd80421a6d2afaa947344f0 Mon Sep 17 00:00:00 2001 From: Guy-Laurent Subri Date: Thu, 10 Oct 2024 13:31:17 +0200 Subject: Add missing 'hidden' attribute (#224) --- CONTRIBUTORS.md | 1 + html/attributes.go | 4 ++++ html/attributes_test.go | 1 + 3 files changed, 6 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 58658f7..03f3c54 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,3 +7,4 @@ in the sidebar, also if you have not contributed code. - Markus Wüstenberg, @markuswustenberg / @maragudk - Hans Raaf, @oderwat +- Guy-Laurent Subri, @glsubri diff --git a/html/attributes.go b/html/attributes.go index 7748e0e..2e9a05a 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -145,6 +145,10 @@ func Height(v string) g.Node { return g.Attr("height", v) } +func Hidden(v string) g.Node { + return g.Attr("hidden", v) +} + func Href(v string) g.Node { return g.Attr("href", v) } diff --git a/html/attributes_test.go b/html/attributes_test.go index 8f72e41..e5ea3f4 100644 --- a/html/attributes_test.go +++ b/html/attributes_test.go @@ -62,6 +62,7 @@ func TestSimpleAttributes(t *testing.T) { {Name: "for", Func: For}, {Name: "form", Func: FormAttr}, {Name: "height", Func: Height}, + {Name: "hidden", Func: Hidden}, {Name: "href", Func: Href}, {Name: "id", Func: ID}, {Name: "integrity", Func: Integrity}, -- cgit 1.4.1