machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Ensure quotes around bound attribute values #302

Closed quaelin closed 6 years ago

quaelin commented 6 years ago

Fixes machty/emblem.js#300.

@thec0keman

/cc @jmerrifield

thec0keman commented 6 years ago

Thanks for submitting!

I think we need to blacklist these changes for dom events. For example, this is invalid syntax for Ember: <select onchange=\"{{action (mut vehicle) value="target.value"}}\"></select>

This is because the action helper generates a closure that is assigned to the dom event. I'm pretty sure events would be the only dom elements that shouldn't have strings.

quaelin commented 6 years ago

Ok. Do you think it would work to blacklist these changes for any attribute beginning with "on"? That seems easier to maintain than an explicit list like onchange, onfocus, onblur, onmouseover....

thec0keman commented 6 years ago

That seems to be valid

quaelin commented 6 years ago

@thec0keman ok, made that change 👍

quaelin commented 6 years ago

Thanks for merging, @thec0keman. Any thoughts on when you might plan to publish a new version to npm?

thec0keman commented 6 years ago

:+1: