diff options
author | Julien Tant | 2024-06-05 16:54:52 -0700 |
---|---|---|
committer | Julien Tant | 2024-06-05 16:54:52 -0700 |
commit | 600b6c34df94ad0917970669680629260394ce7d (patch) | |
tree | cf9feed4255a60b6af2913814ef1d6cef09c0dc7 | |
parent | 5fa128bc8f245386539edf6002874aa4c2979ea6 (diff) | |
download | gomponents-600b6c34df94ad0917970669680629260394ce7d.tar.lz gomponents-600b6c34df94ad0917970669680629260394ce7d.tar.zst gomponents-600b6c34df94ad0917970669680629260394ce7d.zip |
add script's integrity and crossorigin attributes
-rw-r--r-- | html/attributes.go | 8 | ||||
-rw-r--r-- | html/attributes_test.go | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index b38dd95..8988ab3 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -24,6 +24,10 @@ func Controls() g.Node { return g.Attr("controls") } +func CrossOrigin(v string) g.Node { + return g.Attr("crossorigin", v) +} + func Defer() g.Node { return g.Attr("defer") } @@ -130,6 +134,10 @@ func ID(v string) g.Node { return g.Attr("id", v) } +func Integrity(v string) g.Node { + return g.Attr("integrity", v) +} + func Lang(v string) g.Node { return g.Attr("lang", v) } diff --git a/html/attributes_test.go b/html/attributes_test.go index bcb6daf..1478b61 100644 --- a/html/attributes_test.go +++ b/html/attributes_test.go @@ -47,12 +47,14 @@ func TestSimpleAttributes(t *testing.T) { "cols": Cols, "colspan": ColSpan, "content": Content, + "crossorigin": CrossOrigin, "enctype": EncType, "for": For, "form": FormAttr, "height": Height, "href": Href, "id": ID, + "integrity": Integrity, "lang": Lang, "loading": Loading, "max": Max, |