choojs / hyperx

🏷 - tagged template string virtual dom builder
BSD 2-Clause "Simplified" License
1.01k stars 48 forks source link

Fix readme and test as custom attrs dont work in the browser with hyperscript #64

Closed shama closed 6 years ago

shama commented 6 years ago

Fixes GH-59

This example:

var tree = hx`<div>
  <h1 y="ab${1+2}cd">hello ${title}!</h1>
</div>`
console.log(tree.outerHTML)

works fine on the server but in the browser, hyperscript ignores the y="" attribute. So updating the example and test to use data-y="" with a note about why we dont use custom attributes with hyperscript.