hyperscript icon indicating copy to clipboard operation
hyperscript copied to clipboard

Merge classes from tag and attributes

Open kyptin opened this issue 3 years ago • 0 comments

Before this commit, the following code:

const h = require('hyperscript')
h('.c1.c2', {class: 'c2 c3'}, 'Hello').outerHTML

...yields:

'<div class="c1 c2" class="c2 c3">Hello</div>'

This is actually incorrect HTML according to the W3C Markup Validator.

The correct output would of course be:

'<div class="c1 c2 c3">Hello</div>'

This commit achieves the correct output.

kyptin avatar May 28 '21 02:05 kyptin