When running the following code:
importhtmfrom'https://unpkg.com/htm?module'functionh(type,props, ...children){return{ type, props, children };}consthtml=htm.bind(h);console.log(html`<div><b>bold</b> regular</div>`);I am getting the following object:
{type: 'div',props: null,children: [{type: 'b'/* , ... */},'regular']}The string have been auto-formatted but still seems to be a valid HTML code. Now I have implemented my own h() function as I'd like to compose the DOM elements in my way. However, I don't see any obvious way to split bold and regular elements with a space except for inserting (#234). I'd appreciate any comments on this.
When running the following code:
I am getting the following object:
The string have been auto-formatted but still seems to be a valid HTML code. Now I have implemented my own
h()function as I'd like to compose the DOM elements in my way. However, I don't see any obvious way to splitboldandregularelements with a space except for inserting (#234). I'd appreciate any comments on this.