Cannot interpolate string attributes directly
tbranyen opened this issue · 1 comments
tbranyen commented
This works:
<a href=${`https://${someHost}`} />
But this does not:
<a href="https://${someHost}">
tbranyen commented
I've fixed this in the new parser.
Old:
> require('./packages/diffhtml/dist/cjs').html`<a href="https://${'test'}">`
{
rawNodeName: 'a',
nodeName: 'a',
nodeValue: '',
nodeType: 1,
key: '',
childNodes: [],
attributes: { href: 'https://__DIFFHTML__0__' }
}
New:
require('./packages/diffhtml/dist/cjs').html`<a href="https://${'test'}">`
{
rawNodeName: 'a',
nodeName: 'a',
nodeValue: '',
nodeType: 1,
key: '',
childNodes: [],
attributes: { href: 'https://test' }
}