Add data- attribute helper (#61) Fixes #49.
1 file changed, 7 insertions(+), 0 deletions(-)
changed files
M html/attributes_test.go → html/attributes_test.go
@@ -83,3 +83,10 @@ n := Aria("selected", "true") assert.Equal(t, ` aria-selected="true"`, n) }) } + +func TestDataAttr(t *testing.T) { + t.Run("returns an attribute which name is prefixed with data-", func(t *testing.T) { + n := DataAttr("id", "partyhat") + assert.Equal(t, ` data-id="partyhat"`, n) + }) +}