Describe the bug
The parameter type of the class attribute function accepts a string or an array of strings.
But when using an array it will call .join() which results in class="one,two,three".

To Reproduce
Steps to reproduce the behavior:
- Create an element:
h.p.class(['one', 'two', 'three'])('hello')
- Inspect the element in the DOM
- The classes are joined with
,
<p class="one,two,three">hello</p>
Expected behavior
The classes should be joined using spaces:
<p class="one two three">hello</p>
Screenshots

Desktop (please complete the following information):
- OS: macOS
- Browser: Brave
- Version: 1.36
- Node: 16.13.0
- Eleventy: 1.0.0
Additional context
Right now we either need to use a string or add a custom plugin:
setPlugins(h, [
{
attribute: (tagName, key, args) => {
if (key === "class" && Array.isArray(args)) {
return [key, args.join(" ")];
}
return [key, args];
},
},
]);
Describe the bug
The parameter type of the
classattribute function accepts a string or an array of strings.But when using an array it will call
.join()which results inclass="one,two,three".To Reproduce
Steps to reproduce the behavior:
h.p.class(['one', 'two', 'three'])('hello'),Expected behavior
The classes should be joined using spaces:
Screenshots

Desktop (please complete the following information):
Additional context
Right now we either need to use a string or add a custom plugin: