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

Multi-line [ properties ] set hasBlock to true #265

Closed buschtoens closed 8 years ago

buschtoens commented 8 years ago
/ foo-bar.emblem

if hasBlock
  | A block for you:
  = yield
else
  | A message for you:
  = message
/ application.emblem

= foo-bar [
  message="I love you."]

Expected result:

<div class="ember-view">
  A message for you: I love you.
</div>

Actual result:

<div class="ember-view">
  A block for you:
</div>
NuckChorris commented 8 years ago

For some reason the [ multi line properties ] force the block to compile to {{#foo-bar}} even if it doesn't have a block

thec0keman commented 8 years ago

Confirmed. However, this will work as expected:

= foo-bar [
  message='test'
]

I'll work on a patch for this behavior.