Skip to content

Commit

Permalink
Add dir (#176)
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
amrojjeh committed Jun 19, 2024
1 parent b950ec2 commit a75b253
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions html/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 270,7 @@ func Width(v string) g.Node {
func EncType(v string) g.Node {
return g.Attr("enctype", v)
}

func Dir(v string) g.Node {
return g.Attr("dir", v)
}
1 change: 1 addition & 0 deletions html/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 55,7 @@ func TestSimpleAttributes(t *testing.T) {
{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},
Expand Down

0 comments on commit a75b253

Please sign in to comment.