diff --git a/elements.go b/elements.go index 1ad8360..c400ccf 100644 --- a/elements.go +++ b/elements.go @@ -88,6 +88,11 @@ func H6(attrs attrs.Props, children ...Node) *Element { return newElement("h6", attrs, children...) } +// Hgroup creates an
element. +func Hgroup(attrs attrs.Props, children ...Node) *Element { + return newElement("hgroup", attrs, children...) +} + // Hr creates an
element. func Hr(attrs attrs.Props) *Element { return newElement("hr", attrs) diff --git a/elements_test.go b/elements_test.go index 3da485b..25159f0 100644 --- a/elements_test.go +++ b/elements_test.go @@ -329,6 +329,12 @@ func TestSection(t *testing.T) { assert.Equal(t, expected, el.Render()) } +func TestHgroup(t *testing.T) { + expected := `

Frankenstein

Or: The Modern Prometheus

` + el := Hgroup(nil, H1(nil, Text("Frankenstein")), P(nil, Text("Or: The Modern Prometheus"))) + assert.Equal(t, expected, el.Render()) +} + // --- Semantic Form Elements --- func TestFieldset(t *testing.T) {