about summary refs log tree commit diff stats
path: root/attr/boolean_test.go
diff options
context:
space:
mode:
authorMarkus Wüstenberg2020-11-16 12:38:24 +0100
committerGitHub2020-11-16 12:38:24 +0100
commit794c3b26acbd3931b7973ff7e09a42b0ac414b1c (patch)
treeac909b96ce6cca65b71828deca179db8e22e2995 /attr/boolean_test.go
parent87d09c382434c9198c50356954fedf0ab8e5576f (diff)
downloadgomponents-794c3b26acbd3931b7973ff7e09a42b0ac414b1c.tar.lz
gomponents-794c3b26acbd3931b7973ff7e09a42b0ac414b1c.tar.zst
gomponents-794c3b26acbd3931b7973ff7e09a42b0ac414b1c.zip
Render correct HTML5 (#44)
Previously, elements of kind void and empty elements generally would be rendered auto-closing (with a final `/` character in the start tag), which is allowed sometimes but arguably wrong. See https://dev.w3.org/html5/spec-LC/syntax.html#end-tags

This created problems with for example `textarea` and `script`, which cannot be auto-closing, or the browser renders it wrong.

Also clarified in the docs that this library outputs HTML5.

Fixes #42.
Diffstat (limited to 'attr/boolean_test.go')
-rw-r--r--attr/boolean_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/attr/boolean_test.go b/attr/boolean_test.go
index 4e6bb37..309b025 100644
--- a/attr/boolean_test.go
+++ b/attr/boolean_test.go
@@ -26,7 +26,7 @@ func TestBooleanAttributes(t *testing.T) {
 	for name, fn := range cases {
 		t.Run(fmt.Sprintf("should output %v", name), func(t *testing.T) {
 			n := g.El("div", fn())
-			assert.Equal(t, fmt.Sprintf(`<div %v />`, name), n)
+			assert.Equal(t, fmt.Sprintf(`<div %v></div>`, name), n)
 		})
 	}
 }