Assigned attribute values are no longer quoted
See original GitHub issueI work on a large non-Ember app making extensive use of Emblem templates. We’re currently trying to upgrade from 0.4.0 to current but have encountered what seems to be a breaking change that I don’t see mentioned in the CHANGELOG.
Given this Emblem template: input type="text" placeholder=placeholder
, and the value “multiple words” for placeholder
, under 0.4.0 the eventual value for placeholder
would be wrapped in quotes:
<!-- Output from Emblem 0.4.0 -->
<input type="text" placeholder="multiple words" />
The newest version, however, results in an unquoted attribute value and broken markup:
<!-- Output from Emblem 0.9.0 -->
<input type="text" placeholder=multiple words>
Is this intentional? Are we now meant to use something like attr="{{ variable }}"
instead?
Converting ~14k lines of Emblem to use a different attribute assignment syntax would be prohibitive for us. Would you consider a PR that restored the previous behavior? It looks like adding opening and closing quotes to this line in template-compiler.js would have the desired effect.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
👍 I have a PR that I just opened. I’d like to do a bit of QA, then get it merged as 0.9.3.
That would be fine, we control the compilation stage so can easily supply extra options to
emblem.compile
.How would you like to proceed? Are you planning to revert this PR and push a fixed version to NPM? We are out for the holidays so may not be able to work on an option-driven implementation until the new year.