all repos — gomponents @ a75b25333d94bef710bbc05a95baa2e77b61bca9

HTML components in pure Go

Add dir (#176) `dir` is a global attribute that lets you specify whether text is RTL or LTR or if it should be determined by the browser. Documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir

Amr Ojjeh
commit

a75b25333d94bef710bbc05a95baa2e77b61bca9

parent

b950ec2c42bd613fa23625ab6360f58b9ba28e07

2 files changed, 5 insertions(+), 0 deletions(-)

changed files
M html/attributes.gohtml/attributes.go
@@ -270,3 +270,7 @@
func EncType(v string) g.Node { return g.Attr("enctype", v) } + +func Dir(v string) g.Node { + return g.Attr("dir", v) +}
M html/attributes_test.gohtml/attributes_test.go
@@ -55,6 +55,7 @@ {Name: "colspan", Func: ColSpan},
{Name: "content", Func: Content}, {Name: "crossorigin", Func: CrossOrigin}, {Name: "enctype", Func: EncType}, + {Name: "dir", Func: Dir}, {Name: "for", Func: For}, {Name: "form", Func: FormAttr}, {Name: "height", Func: Height},