nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: maragudk/gomponents
Pull request #32 (2020-10-23 10:11:28)

Don't render or error on nil children
This makes it easier to e.g. conditionally skip a component for rendering.

codecov[bot]: # [Codecov](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=h1) Report
> Merging [#32](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=desc) into [master](https://codecov.io/gh/maragudk/gomponents/commit/6d2fb0eeb15d6b9774f127517d160137251264a4?el=desc) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/maragudk/gomponents/pull/32/graphs/tree.svg?width=650&height=150&src=pr&token=JYN032TYAC)](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##            master       #32   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          116       118    +2     
=========================================
+ Hits           116       118    +2     
```


| [Impacted Files](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [gomponents.go](https://codecov.io/gh/maragudk/gomponents/pull/32/diff?src=pr&el=tree#diff-Z29tcG9uZW50cy5nbw==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=footer). Last update [6d2fb0e...d0f1bbb](https://codecov.io/gh/maragudk/gomponents/pull/32?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/gomponents.go b/gomponents.go
index c0aa510..ee156b9 100644
--- a/gomponents.go
+++ b/gomponents.go
@@ -84,6 +84,9 @@ func El(name string, children ...Node) NodeFunc {
 }
 
 func renderChild(c Node, inside, outside *strings.Builder) {
+	if c == nil {
+		return
+	}
 	if g, ok := c.(group); ok {
 		for _, groupC := range g.children {
 			renderChild(groupC, inside, outside)


Test patch:
diff --git a/gomponents_test.go b/gomponents_test.go
index db9256c..33d32d1 100644
--- a/gomponents_test.go
+++ b/gomponents_test.go
@@ -83,6 +83,11 @@ func TestEl(t *testing.T) {
 		e := g.El("div", outsider{})
 		assert.Equal(t, `<div>outsider</div>`, e)
 	})
+
+	t.Run("does not fail on nil node", func(t *testing.T) {
+		e := g.El("div", g.El("span"), nil, g.El("span"))
+		assert.Equal(t, `<div><span /><span /></div>`, e)
+	})
 }
 
 func TestText(t *testing.T) {
Repository: maragudk/gomponents
Pull request #79 (2021-06-08 14:50:55)

Add LinkStylesheet and LinkPreload components
These are often used in the `<head>` part of the HTML.


Patch:
diff --git a/components/elements.go b/components/elements.go
index f4e347d..c9e1427 100644
--- a/components/elements.go
+++ b/components/elements.go
@@ -8,3 +8,11 @@ import (
 func InputHidden(name, value string, children ...g.Node) g.Node {
 	return Input(Type("hidden"), Name(name), Value(value), g.Group(children))
 }
+
+func LinkStylesheet(href string, children ...g.Node) g.Node {
+	return Link(Rel("stylesheet"), Href(href), g.Group(children))
+}
+
+func LinkPreload(href, as string, children ...g.Node) g.Node {
+	return Link(Rel("preload"), Href(href), As(as), g.Group(children))
+}
diff --git a/html/attributes.go b/html/attributes.go
index 23559f6..ab575d8 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -61,6 +61,10 @@ func Aria(name, v string) g.Node {
 	return g.Attr("aria-"+name, v)
 }
 
+func As(v string) g.Node {
+	return g.Attr("as", v)
+}
+
 func AutoComplete(v string) g.Node {
 	return g.Attr("autocomplete", v)
 }


Test patch:
diff --git a/components/elements_test.go b/components/elements_test.go
index 334ed2c..7dc4eec 100644
--- a/components/elements_test.go
+++ b/components/elements_test.go
@@ -14,3 +14,17 @@ func TestInputHidden(t *testing.T) {
 		assert.Equal(t, `<input type="hidden" name="id" value="partyhat" class="hat">`, n)
 	})
 }
+
+func TestLinkStylesheet(t *testing.T) {
+	t.Run("returns a link element with rel stylesheet and the given href", func(t *testing.T) {
+		n := c.LinkStylesheet("style.css", g.Attr("media", "print"))
+		assert.Equal(t, `<link rel="stylesheet" href="style.css" media="print">`, n)
+	})
+}
+
+func TestLinkPreload(t *testing.T) {
+	t.Run("returns a link element with rel preload and the given href and as", func(t *testing.T) {
+		n := c.LinkPreload("party.woff2", "font", g.Attr("type", "font/woff2"))
+		assert.Equal(t, `<link rel="preload" href="party.woff2" as="font" type="font/woff2">`, n)
+	})
+}
diff --git a/html/attributes_test.go b/html/attributes_test.go
index b0f76c1..1d0b312 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -36,6 +36,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"accept":       Accept,
 		"action":       Action,
 		"alt":          Alt,
+		"as":           As,
 		"autocomplete": AutoComplete,
 		"charset":      Charset,
 		"class":        Class,
Repository: maragudk/gomponents
Pull request #109 (2022-09-29 10:45:48)

Add EncType html attribute


Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 5a3dc3a..7733457 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -217,3 +217,7 @@ func Value(v string) g.Node {
 func Width(v string) g.Node {
 	return g.Attr("width", v)
 }
+
+func EncType(v string) g.Node {
+	return g.Attr("enctype", v)
+}


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 665dc94..50f0b53 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -45,6 +45,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"class":        Class,
 		"cols":         Cols,
 		"content":      Content,
+		"enctype":      EncType,
 		"for":          For,
 		"form":         FormAttr,
 		"height":       Height,
Repository: maragudk/gomponents
Pull request #114 (2022-11-03 10:21:12)

Add Rawf
Like `Raw`, but interpolates like `Textf`.


Patch:
diff --git a/gomponents.go b/gomponents.go
index 4f610f4..9f86538 100644
--- a/gomponents.go
+++ b/gomponents.go
@@ -4,7 +4,7 @@
 // to the given writer as a string.
 //
 // All DOM elements and attributes can be created by using the El and Attr functions.
-// The functions Text, Textf, and Raw can be used to create text nodes.
+// The functions Text, Textf, Raw, and Rawf can be used to create text nodes.
 // See also helper functions Group, Map, and If.
 //
 // For basic HTML elements and attributes, see the package html.
@@ -207,7 +207,7 @@ func Text(t string) Node {
 	})
 }
 
-// Textf creates a text DOM Node that Renders the interpolated and escaped string t.
+// Textf creates a text DOM Node that Renders the interpolated and escaped string format.
 func Textf(format string, a ...interface{}) Node {
 	return NodeFunc(func(w io.Writer) error {
 		_, err := w.Write([]byte(template.HTMLEscapeString(fmt.Sprintf(format, a...))))
@@ -223,6 +223,14 @@ func Raw(t string) Node {
 	})
 }
 
+// Rawf creates a text DOM Node that just Renders the interpolated and unescaped string format.
+func Rawf(format string, a ...interface{}) Node {
+	return NodeFunc(func(w io.Writer) error {
+		_, err := w.Write([]byte(fmt.Sprintf(format, a...)))
+		return err
+	})
+}
+
 type group struct {
 	children []Node
 }


Test patch:
diff --git a/gomponents_test.go b/gomponents_test.go
index ffde46d..32304f3 100644
--- a/gomponents_test.go
+++ b/gomponents_test.go
@@ -212,6 +212,21 @@ func ExampleRaw() {
 	// Output: <span><button onclick="javascript:alert('Party time!')">Party hats</button> &gt; normal hats.</span>
 }
 
+func TestRawf(t *testing.T) {
+	t.Run("renders interpolated and raw text", func(t *testing.T) {
+		e := g.Rawf("<%v>", "div")
+		assert.Equal(t, "<div>", e)
+	})
+}
+
+func ExampleRawf() {
+	e := g.El("span",
+		g.Rawf(`<button onclick="javascript:alert('%v')">Party hats</button> &gt; normal hats.`, "Party time!"),
+	)
+	_ = e.Render(os.Stdout)
+	// Output: <span><button onclick="javascript:alert('Party time!')">Party hats</button> &gt; normal hats.</span>
+}
+
 func TestGroup(t *testing.T) {
 	t.Run("groups multiple nodes into one", func(t *testing.T) {
 		children := []g.Node{g.El("br", g.Attr("id", "hat")), g.El("hr")}
Repository: maragudk/gomponents
Pull request #116 (2022-11-15 13:46:04)

Add stroke-width SVG attribute


Patch:
diff --git a/svg/attributes.go b/svg/attributes.go
index 10b7c69..52c9c61 100644
--- a/svg/attributes.go
+++ b/svg/attributes.go
@@ -24,6 +24,10 @@ func Stroke(v string) g.Node {
 	return g.Attr("stroke", v)
 }
 
+func StrokeWidth(v string) g.Node {
+	return g.Attr("stroke-width", v)
+}
+
 func ViewBox(v string) g.Node {
 	return g.Attr("viewBox", v)
 }


Test patch:
diff --git a/svg/attributes_test.go b/svg/attributes_test.go
index c41fb45..7e26548 100644
--- a/svg/attributes_test.go
+++ b/svg/attributes_test.go
@@ -11,12 +11,13 @@ import (
 
 func TestSimpleAttributes(t *testing.T) {
 	cases := map[string]func(string) g.Node{
-		"clip-rule": ClipRule,
-		"d":         D,
-		"fill":      Fill,
-		"fill-rule": FillRule,
-		"stroke":    Stroke,
-		"viewBox":   ViewBox,
+		"clip-rule":    ClipRule,
+		"d":            D,
+		"fill":         Fill,
+		"fill-rule":    FillRule,
+		"stroke":       Stroke,
+		"stroke-width": StrokeWidth,
+		"viewBox":      ViewBox,
 	}
 
 	for name, fn := range cases {
Repository: maragudk/gomponents
Pull request #125 (2023-01-17 11:58:24)

Add ColSpan and RowSpan attributes


Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 7733457..5e56683 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -93,6 +93,10 @@ func Cols(v string) g.Node {
 	return g.Attr("cols", v)
 }
 
+func ColSpan(v string) g.Node {
+	return g.Attr("colspan", v)
+}
+
 func Content(v string) g.Node {
 	return g.Attr("content", v)
 }
@@ -182,6 +186,10 @@ func Rows(v string) g.Node {
 	return g.Attr("rows", v)
 }
 
+func RowSpan(v string) g.Node {
+	return g.Attr("rowspan", v)
+}
+
 func Src(v string) g.Node {
 	return g.Attr("src", v)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 50f0b53..4071101 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -44,6 +44,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"charset":      Charset,
 		"class":        Class,
 		"cols":         Cols,
+		"colspan":      ColSpan,
 		"content":      Content,
 		"enctype":      EncType,
 		"for":          For,
@@ -66,6 +67,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"rel":          Rel,
 		"role":         Role,
 		"rows":         Rows,
+		"rowspan":      RowSpan,
 		"src":          Src,
 		"srcset":       SrcSet,
 		"style":        StyleAttr,
Repository: maragudk/gomponents
Pull request #173 (2024-06-05 23:59:31)

Add script's `integrity` and `crossorigin` attributes
When using `<script>` to pull a library from a CDN, it's usually a good idea to attach an integrity check so that if they get hacked and someone changes all the script, malicious scripts don't get executed on your website.

To achieve this, you need to attach `integrity` and `crossorigin` to your `<script/>` tag

```go
Script(
	Scr("https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"),
	Integrity("sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"),
	CrossOrigin("anonymous"),
)
```
Turns into
```html
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" 
    integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" 
    crossorigin="anonymous"></script>
```

Hint for whoever likes unpkg.com, adding `?meta` at the end of any script you import form them will give you the current `integrity` for the file. Example: https://unpkg.com/three@0.165.0/build/three.cjs?meta


Patch:
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)
 }


Test patch:
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,
Repository: maragudk/gomponents
Pull request #176 (2024-06-18 17:36:00)

Add dir
`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

markuswustenberg: Hey @amrojjeh , thank you for the contribution! 😊

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 728807b..98d70ff 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -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)
+}


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index acd17be..0deb06c 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -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},
Repository: maragudk/gomponents
Pull request #177 (2024-06-20 15:19:41)

Add datetime attribute
`<time>`, `<del>` and `<ins>` can receive a [`datetime`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement/dateTime) attribute

markuswustenberg: @JulienTant thanks! 

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 98d70ff..8a1d11e 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -28,6 +28,10 @@ func CrossOrigin(v string) g.Node {
 	return g.Attr("crossorigin", v)
 }
 
+func DateTime(v string) g.Node {
+	return g.Attr("datetime", v)
+}
+
 func Defer() g.Node {
 	return g.Attr("defer")
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 0deb06c..aba185e 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -54,6 +54,7 @@ func TestSimpleAttributes(t *testing.T) {
 		{Name: "colspan", Func: ColSpan},
 		{Name: "content", Func: Content},
 		{Name: "crossorigin", Func: CrossOrigin},
+		{Name: "datetime", Func: DateTime},
 		{Name: "enctype", Func: EncType},
 		{Name: "dir", Func: Dir},
 		{Name: "for", Func: For},
Repository: maragudk/gomponents
Pull request #185 (2024-07-04 13:49:50)

Update attributes.go - add draggable attribute
add draggable attribute

markuswustenberg: Thanks! Could you add it to the table test as well?
markuswustenberg: Oh, could you remove the changes to .gitignore as well? :)

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 8a1d11e..edaf85e 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -40,6 +40,10 @@ func Disabled() g.Node {
 	return g.Attr("disabled")
 }
 
+func Draggable(v string) g.Node {
+	return g.Attr("draggable", v)
+}
+
 func Loop() g.Node {
 	return g.Attr("loop")
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index aba185e..92ce0d6 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -55,6 +55,7 @@ func TestSimpleAttributes(t *testing.T) {
 		{Name: "content", Func: Content},
 		{Name: "crossorigin", Func: CrossOrigin},
 		{Name: "datetime", Func: DateTime},
+		{Name: "draggable", Func: Draggable},
 		{Name: "enctype", Func: EncType},
 		{Name: "dir", Func: Dir},
 		{Name: "for", Func: For},
Repository: maragudk/gomponents
Pull request #224 (2024-10-09 17:00:08)

Add missing 'hidden' attribute
Hey @markuswustenberg 

I realised today that gomponents had no `hidden` attribute. So I thought I could add it.

However, quickly going through MDN, I realised that it could also take the 'until-found' string value (see [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden#the_hidden_until_found_state)).

I think it would be nicer to have something like this:

```go
func Hidden() g.Node {
	return g.Attr("hidden")
}

func HiddenUntilFound() g.Node {
	return g.Attr("hidden", "until-found")
}

func example() g.Node {
	return Div(
		Hidden(),
	)
}
```

Instead of 
```go
func Hidden(v string) g.Node {
	return g.Attr("hidden", v)
}

func example() g.Node {
	return Div(
		Hidden(""),
	)
}

```

I know that it deviates a bit from the way you've written the other attributes but this feels nicer to me.

What do you think ?

markuswustenberg: @glsubri thanks for this!

HTML is just the gift that keeps on giving with new surprises. 😅

I value consistency _a lot_, so I would lean towards adding just:

```go
func Hidden(v string) g.Node {
	return g.Attr("hidden", v)
}
```

And letting the user figure it out according to the docs. Since `hidden`, `hidden=""`, and `hidden="hidden"` are equivalent, I wouldn't mind the additional empty string argument.

Thoughts?
glsubri: Hey @markuswustenberg 

Works for me. I've made the changes 👍
markuswustenberg: Thanks!

Patch:
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 58658f7..03f3c54 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -7,3 +7,4 @@ in the sidebar, also if you have not contributed code.
 
 - Markus Wüstenberg, @markuswustenberg / @maragudk
 - Hans Raaf, @oderwat
+- Guy-Laurent Subri, @glsubri
diff --git a/html/attributes.go b/html/attributes.go
index 7748e0e..2e9a05a 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -145,6 +145,10 @@ func Height(v string) g.Node {
 	return g.Attr("height", v)
 }
 
+func Hidden(v string) g.Node {
+	return g.Attr("hidden", v)
+}
+
 func Href(v string) g.Node {
 	return g.Attr("href", v)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 8f72e41..e5ea3f4 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -62,6 +62,7 @@ func TestSimpleAttributes(t *testing.T) {
 		{Name: "for", Func: For},
 		{Name: "form", Func: FormAttr},
 		{Name: "height", Func: Height},
+		{Name: "hidden", Func: Hidden},
 		{Name: "href", Func: Href},
 		{Name: "id", Func: ID},
 		{Name: "integrity", Func: Integrity},
Repository: maragudk/gomponents
Pull request #235 (2024-10-25 14:47:13)

Add web component elements and slot attribute
The slot attribute is a standard attribute for use with web components: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots

markuswustenberg: Thanks! I don’t think we have the `template` and `slot` elements either?
knpwrs: I was thinking about that and couldn't think of a situation where I (in my workflow) would server-render `<template>` or `<slot>`. I can add them though, others may have a use-case.
markuswustenberg: D’oh, we run into a naming collision of course. Could you suffix each of `Slot` with `El` and `Attr`? And not add the non-suffixed version for now. 
knpwrs: Should be all set now.
markuswustenberg: Thanks! Now just add them to the test tables and we’re set. 😊
knpwrs: Tests should be all set now

markuswustenberg: 🥳

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 2e9a05a..be8393e 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -133,6 +133,10 @@ func DataAttr(name, v string) g.Node {
 	return Data(name, v)
 }
 
+func SlotAttr(v string) g.Node {
+  return g.Attr("slot", v)
+}
+
 func For(v string) g.Node {
 	return g.Attr("for", v)
 }
diff --git a/html/elements.go b/html/elements.go
index efc83df..bf747a1 100644
--- a/html/elements.go
+++ b/html/elements.go
@@ -264,6 +264,10 @@ func Select(children ...g.Node) g.Node {
 	return g.El("select", children...)
 }
 
+func SlotEl(children ...g.Node) g.Node {
+	return g.El("slot", children...)
+}
+
 func Source(children ...g.Node) g.Node {
 	return g.El("source", children...)
 }
@@ -296,6 +300,10 @@ func Td(children ...g.Node) g.Node {
 	return g.El("td", children...)
 }
 
+func Template(children ...g.Node) g.Node {
+	return g.El("template", children...)
+}
+
 func Textarea(children ...g.Node) g.Node {
 	return g.El("textarea", children...)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index e5ea3f4..67b98f4 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -84,6 +84,7 @@ func TestSimpleAttributes(t *testing.T) {
 		{Name: "role", Func: Role},
 		{Name: "rows", Func: Rows},
 		{Name: "rowspan", Func: RowSpan},
+		{Name: "slot", Func: SlotAttr},
 		{Name: "src", Func: Src},
 		{Name: "srcset", Func: SrcSet},
 		{Name: "step", Func: Step},
diff --git a/html/elements_test.go b/html/elements_test.go
index 0b9dd02..5fe6268 100644
--- a/html/elements_test.go
+++ b/html/elements_test.go
@@ -103,6 +103,7 @@ func TestSimpleElements(t *testing.T) {
 		{Name: "script", Func: Script},
 		{Name: "section", Func: Section},
 		{Name: "select", Func: Select},
+		{Name: "slot", Func: SlotEl},
 		{Name: "small", Func: Small},
 		{Name: "span", Func: Span},
 		{Name: "strong", Func: Strong},
@@ -114,6 +115,7 @@ func TestSimpleElements(t *testing.T) {
 		{Name: "table", Func: Table},
 		{Name: "tbody", Func: TBody},
 		{Name: "td", Func: Td},
+		{Name: "template", Func: Template},
 		{Name: "textarea", Func: Textarea},
 		{Name: "tfoot", Func: TFoot},
 		{Name: "th", Func: Th},