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

Fix issue where component bracket syntax would not allow closing brac… #236

Closed thec0keman closed 9 years ago

thec0keman commented 9 years ago

Should fix #171

kjhangiani commented 9 years ago

Is this merged in yet? Dying to get this fix into my codebase, multi line bracket syntax would be a huge help. Couldn't figure out how to shrinkwrap this properly so ember-cli-emblem uses it.. please merge in if its ready!

wmlele commented 9 years ago

+1

kjhangiani commented 9 years ago

Any update here? Managed to fork the PR and build it, but can't seem to figure out how to get it working with ember-cli-emblem, even when I fork that repo, I get a module cannot be loaded error on the require('emblem') line in ember-cli-emblem.

Desperately want this feature though as we have lots of components with many passed in attributes and this would make the code so much cleaner.

calvinalvin commented 9 years ago

+1

machty commented 9 years ago

@thec0keman could you rebase? I tried to do it myself but there are some new circular dependencies you might best be able to resolve.

And sorry for the delay! I'm finding a bit more time for things these days so I'll be quick to respond from now on.

thec0keman commented 9 years ago

@machty should be good to go.

Thanks!

kjhangiani commented 9 years ago

Awesome, thanks for this. One thing I noticed - this seems to be pretty sensitive to tabs vs spaces, not sure if this is intended, but it's a little annoying. Here's an example, using \t and \s for tab and space respectively (extra space after indent sequences for clarity in example)

Doesn't work:

div
\t = inline-textarea [
\t\t prop1="someprop"
\t\t prop2=boundValue
\t ]

Works:

div
\t = inline-textarea [
\t\s\s prop1="someprop"
\t\s\s prop2=boundValue
\t ]

I prefer to use \t for indenting over \s because then each person can use their preferred editor settings for tab sizes, but now I'm forced to either convert tabs to spaces (which I hate), or remember that to indent inside [ ] syntax I have to use spaces.

It's still a massive improvement but is there any chance this could be addressed?