diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | html/elements.go | 5 | ||||
-rw-r--r-- | html/elements_test.go | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md index 744b104..f525c3b 100644 --- a/README.md +++ b/README.md @@ -145,11 +145,12 @@ For more complete examples, see [the examples directory](examples/). ### What's up with the specially named elements and attributes? -Unfortunately, there are four main name clashes in HTML elements and attributes, so they need an `El` or `Attr` suffix, +Unfortunately, there are five main name clashes in HTML elements and attributes, so they need an `El` or `Attr` suffix, to be able to co-exist in the same package in Go. I've chosen one or the other based on what I think is the common usage. In either case, the less-used variant also exists in the codebase: - `data` (`DataEl`/`Data`, `DataAttr` also exists) - `form` (`Form`/`FormAttr`, `FormEl` also exists) +- `label` (`Label`/`LabelAttr`, `LabelEl` also exists) - `style` (`StyleEl`/`Style`, `StyleAttr` also exists) - `title` (`TitleEl`/`Title`, `TitleAttr` also exists) diff --git a/html/elements.go b/html/elements.go index eb6fbc2..35e5b74 100644 --- a/html/elements.go +++ b/html/elements.go @@ -168,6 +168,11 @@ func Label(children ...g.Node) g.Node { return g.El("label", children...) } +// Deprecated: Use [Label] instead. +func LabelEl(children ...g.Node) g.Node { + return g.El("label", children...) +} + func Legend(children ...g.Node) g.Node { return g.El("legend", children...) } diff --git a/html/elements_test.go b/html/elements_test.go index ffb225a..88688f4 100644 --- a/html/elements_test.go +++ b/html/elements_test.go @@ -79,6 +79,7 @@ func TestSimpleElements(t *testing.T) { {Name: "ins", Func: Ins}, {Name: "kbd", Func: Kbd}, {Name: "label", Func: Label}, + {Name: "label", Func: LabelEl}, {Name: "legend", Func: Legend}, {Name: "li", Func: Li}, {Name: "main", Func: Main}, |