about summary refs log tree commit diff stats
path: root/attr/attributes_test.go
Commit message (Collapse)AuthorAgeLines
* Move elements and attributes into html package (#52)Markus Wüstenberg2020-12-10-32/+0
| | | | | This makes it easier to use dot-imports. Also updated the readme and examples with new usage, and move the `Classes` helper into the `components` package.
* Render correct HTML5 (#44)Markus Wüstenberg2020-11-16-1/+1
| | | | | | | | | 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.
* Add attribute helpers (#35)Markus Wüstenberg2020-10-28-12/+0
| | | Also refactor tests to be table-driven, for readability.
* Add space before auto-closing element (#20)Markus Wüstenberg2020-09-24-1/+1
|
* Introduce Placer interface (#18)Markus Wüstenberg2020-09-24-0/+6
| | | | | When implemented, the `Place` method of the `Placer` interface tells `Render` in `El` where to put a Node. This is relevant for helpers that want to be rendered like attributes, inside the parent element. Fixes the bug where `attr.Classes` was rendered outside the element.
* Make attr.Classes a map type (#14)Markus Wüstenberg2020-09-23-2/+9
| | | This makes the usage syntax prettier. Instead of `attr.Classes(map[string]bool{})`, we can just use `attr.Classes{}`.
* Add package attr with attribute helpers (#7)Markus Wüstenberg2020-09-18-0/+31