From 600b6c34df94ad0917970669680629260394ce7d Mon Sep 17 00:00:00 2001 From: Julien Tant Date: Wed, 5 Jun 2024 16:54:52 -0700 Subject: add script's integrity and crossorigin attributes --- html/attributes.go | 8 ++++++++ html/attributes_test.go | 2 ++ 2 files changed, 10 insertions(+) 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, -- cgit 1.4.1