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

Got \uefff symbol on new line in text param of a component #249

Closed cgwic closed 9 years ago

cgwic commented 9 years ago

simple example:

test-component param='
'

emblem version: 0.5.1
thec0keman commented 9 years ago

Yeah, this makes a lot of sense based on the way emblem parses things.

Is there a use case for having newlines inside text parameters? It looks like Ember escapes these: jsbin.

cgwic commented 9 years ago

@thec0keman I'm not sure, but i can't find the way to pass an object as a param, so i solved this by passing string and then parsing it May be there's better way

In my case i've just made w/a with replacing these symbols so it's not a problem if it's emblem feature

thec0keman commented 9 years ago

Do you mean like the following? = some-component value={ foo: 'bar' }

I don't think Ember supports this. You would need to define the object on the template's context (controller / component) instead.

kjhangiani commented 9 years ago

Would be awesome if ember would support that syntax though... definitely situations where being able to define an object, or at the very least an array inline would be supremely helpful.

cgwic commented 9 years ago

@thec0keman yes, it doesnt. So i use something like:

some-component value='{
"val1": "val1",
"val1": "val1"
}'

and parse it in component.

So now i see that this is a feature with \uefff on line ending and with replace before parsing everything works fine. Thank you for help.