choojs / hyperx

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

inline <style> tags that include direct descendant css selectors break parsing #82

Closed mreinstein closed 1 year ago

mreinstein commented 2 years ago

oy.js:

var vdom = require('virtual-dom')
var hyperx = require('hyperx')
var hx = hyperx(vdom.h)

const tree = hx`<div>
   <style>
       .test > ul {
          background-color: red;
       }
   </style>
</div>`

const r = vdom.create(tree).toString()
console.error(r)

output:

➜ node oy.js

<div>
   <style> ul {
          background-color: red;
       }
   </style>
</div>

➜