hyperscript
hyperscript copied to clipboard
Merge classes from tag and attributes
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.