Article Title
Article content.
diff --git a/attrs/attrs.go b/attrs/attrs.go
index aae7848..b366b34 100644
--- a/attrs/attrs.go
+++ b/attrs/attrs.go
@@ -32,6 +32,9 @@ const (
Width = "width"
IsMap = "ismap"
+ // Semantic Text Attributes
+ DateTime = "datetime"
+
// Form/Input Attributes
Accept = "accept"
Action = "action"
@@ -57,6 +60,9 @@ const (
Type = "type"
Value = "value"
+ // Interactive Attributes
+ Open = "open"
+
// Miscellaneous Attributes
DataPrefix = "data-" // Used for custom data attributes e.g., "data-custom"
Download = "download"
diff --git a/elem.go b/elem.go
index 491ea38..72e7248 100644
--- a/elem.go
+++ b/elem.go
@@ -41,6 +41,7 @@ var booleanAttrs = map[string]struct{}{
attrs.IsMap: {},
attrs.Multiple: {},
attrs.NoValidate: {},
+ attrs.Open: {},
attrs.Readonly: {},
attrs.Required: {},
attrs.Selected: {},
diff --git a/elements.go b/elements.go
index fd97ddb..27c0826 100644
--- a/elements.go
+++ b/elements.go
@@ -162,6 +162,8 @@ func Script(props Attrs, children ...Node) *Element {
// ========== Semantic Elements ==========
+// --- Semantic Sectioning Elements ---
+
func Article(props Attrs, children ...Node) *Element {
return NewElement("article", props, children...)
}
@@ -190,6 +192,36 @@ func Section(props Attrs, children ...Node) *Element {
return NewElement("section", props, children...)
}
+// --- Semantic Text Content Elements ---
+
+func Address(props Attrs, children ...Node) *Element {
+ return NewElement("address", props, children...)
+}
+
+func Details(props Attrs, children ...Node) *Element {
+ return NewElement("details", props, children...)
+}
+
+func FigCaption(props Attrs, children ...Node) *Element {
+ return NewElement("figcaption", props, children...)
+}
+
+func Figure(props Attrs, children ...Node) *Element {
+ return NewElement("figure", props, children...)
+}
+
+func Mark(props Attrs, children ...Node) *Element {
+ return NewElement("mark", props, children...)
+}
+
+func Summary(props Attrs, children ...Node) *Element {
+ return NewElement("summary", props, children...)
+}
+
+func Time(props Attrs, children ...Node) *Element {
+ return NewElement("time", props, children...)
+}
+
// ========== Tables ==========
func Table(props Attrs, children ...Node) *Element {
diff --git a/elements_test.go b/elements_test.go
index d41da69..899498d 100644
--- a/elements_test.go
+++ b/elements_test.go
@@ -251,6 +251,8 @@ func TestScript(t *testing.T) {
// ========== Semantic Elements ==========
+// --- Semantic Sectioning Elements ---
+
func TestArticle(t *testing.T) {
expected := ` Article content.Article Title
Details content here.
Details content here.
Details content here.
You must highlight this word.
` + el := P(nil, Text("You must "), Mark(nil, Text("highlight")), Text(" this word.")) + assert.Equal(t, expected, el.Render()) +} + +func TestSummary(t *testing.T) { + expected := `