shama / yo-yoify

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

Fails on ternary operators in expressions #24

Open timwis opened 8 years ago

timwis commented 8 years ago

The following test case fails with the error Unterminated string constant (10:18).

const html = require('bel')

const req = true

module.exports = () => html`<input type="checkbox" ${req ? 'required' : ''} />`

I've tried required="required", removing the trailing space before />, removing the closing /, and the combinations of the 3, per the related issue #7. They all throw the same error. I'm using v3.4.1.

Any suggestions?

yoshuawuyts commented 8 years ago

I know min-document was recently updated; but yeah no this doesn't seem right - don't know what's at the root cause - I know you mentioend you did stuff like this before; it's a regression right?

timwis commented 8 years ago

I don't know personally that it's a regression; it works fine in bel/yo-yo. I've only used yo-yoify a couple of times. But #7 suggests it's a regression.

yoshuawuyts commented 8 years ago

oh, yeah that's not good :/