shama / yo-yoify

Transform choo, yo-yo or bel template strings into pure and fast document calls
111 stars 17 forks source link

key and bool attr expr fix #41

Closed ghost closed 7 years ago

ghost commented 7 years ago

This patch fixes the case where keys or boolean attributes have an expression in them. For example, this patch fixes these cases:

var html = require('choo/html')
var x = 'disabled'
console.log(html`<input type="type" ${x}>`.toString())
var html = require('choo/html')
var name = 'type'
console.log(html`<input ${name}="text">`.toString())
var html = require('choo/html')
var x = ''
console.log(html`<input type="type" ${x}>`.toString())
gmaclennan commented 7 years ago

Hey I just hit this bug yesterday and thought it was me doing something wrong! Thanks for sending the fix.

yoshuawuyts commented 7 years ago

v3.7.1 :tada: