about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorYarden Shoham2024-08-20 13:08:37 +0300
committerGitHub2024-08-20 12:08:37 +0200
commit9c29bfccdb1a193721f710b45166aad5345ff75a (patch)
treea367fda578acf706e467a1ec0c721a0d8a4b68a6
parent935a601975fa7a15c7ddac097e075209e42974cc (diff)
downloadgomponents-9c29bfccdb1a193721f710b45166aad5345ff75a.tar.lz
gomponents-9c29bfccdb1a193721f710b45166aad5345ff75a.tar.zst
gomponents-9c29bfccdb1a193721f710b45166aad5345ff75a.zip
Reduce code duplication by reusing the correct function in deprecated functions (#194)
-rw-r--r--html/attributes.go6
-rw-r--r--html/elements.go4
2 files changed, 5 insertions, 5 deletions
diff --git a/html/attributes.go b/html/attributes.go
index ccd1cb4..6787cf8 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -130,7 +130,7 @@ func Data(name, v string) g.Node {
 //
 // Deprecated: Use [Data] instead.
 func DataAttr(name, v string) g.Node {
-	return g.Attr("data-"+name, v)
+	return Data(name, v)
 }
 
 func For(v string) g.Node {
@@ -247,7 +247,7 @@ func Style(v string) g.Node {
 
 // Deprecated: Use [Style] instead.
 func StyleAttr(v string) g.Node {
-	return g.Attr("style", v)
+	return Style(v)
 }
 
 func TabIndex(v string) g.Node {
@@ -264,7 +264,7 @@ func Title(v string) g.Node {
 
 // Deprecated: Use [Title] instead.
 func TitleAttr(v string) g.Node {
-	return g.Attr("title", v)
+	return Title(v)
 }
 
 func Type(v string) g.Node {
diff --git a/html/elements.go b/html/elements.go
index 32752ea..86cfbd4 100644
--- a/html/elements.go
+++ b/html/elements.go
@@ -124,7 +124,7 @@ func Form(children ...g.Node) g.Node {
 
 // Deprecated: Use [Form] instead.
 func FormEl(children ...g.Node) g.Node {
-	return g.El("form", children...)
+	return Form(children...)
 }
 
 func FieldSet(children ...g.Node) g.Node {
@@ -177,7 +177,7 @@ func Label(children ...g.Node) g.Node {
 
 // Deprecated: Use [Label] instead.
 func LabelEl(children ...g.Node) g.Node {
-	return g.El("label", children...)
+	return Label(children...)
 }
 
 func Legend(children ...g.Node) g.Node {