-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't support quoted symbols #43
Comments
There are two things I can spot in your Haml:
Testing it in the console looks fine: » coffee
coffee> hc = require 'haml-coffee'
{ compile: [Function],
template: [Function] }
coffee> hc.compile('.whatever{ data: { some-test: "test" } }')()
'<div class=\'whatever\' data-some-test=\'test\'></div>'
coffee> hc.compile('.whatever{ :data => { :some-test => "test" } }')()
'<div class=\'whatever\' data-some-test=\'test\'></div>' I looks like quoting data attributes does indeed not work as intended: coffee> hc.compile(".whatever{ data: { 'some-test': 'test' } }")()
'<div class=\'whatever\' data-\'some-test\'=\'test\'></div>'
coffee> hc.compile(".whatever{ data: { \"some-test\": 'test' } }")()
'<div class=\'whatever\' data-"some-test"=\'test\'></div>' but it works fine for non-data attributes: coffee> hc.compile(".whatever{ \"some-test\": 'test' }")()
'<div class=\'whatever\' some-test=\'test\'></div>'
coffee> hc.compile(".whatever{ 'some-test': 'test' }")()
'<div class=\'whatever\' some-test=\'test\'></div>' I'll fix these on Monday. Thanks for reporting. |
I typo'd the space, that wasn't actually there.
|
I tested in haml, I can combine syntaxes and i cannot use unquoted |
I didn't know that Ruby style attributes can be mixed actually. I'll have a look if I can change that and still can parse inline CoffeeScript code safely. Just pushed a fix for the attribute quote problem to haml-coffee. |
So mixing 1.8 and 1.9 attribute style is now possible in haml-coffee. |
.whatever { data: { :'some-thing' => 'foo' } }
Parses as
As far as I can tell, it's not possible to use dashes in any way. strings don't work on the left hand side either.
The text was updated successfully, but these errors were encountered: