add script's integrity and crossorigin attributes
Julien Tant julien@craftyx.fr
Wed, 05 Jun 2024 16:54:52 -0700
2 files changed, 10 insertions(+), 0 deletions(-)
M html/attributes.go → 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") } @@ -128,6 +132,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 {
M html/attributes_test.go → html/attributes_test.go
@@ -47,12 +47,14 @@ "class": Class, "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,