tj/haml.js

:'data-foo' => 'bar' attribute doesn't work

Closed this issue · 5 comments

For the dash connected attributes, normal I would use the fat arrow syntax for ruby haml compiler, but it does't work in haml.js

Could yo improve this or tell me the right way to do it in haml.js

{ "data-foo": "bar" }

@saschagehlich I think { "data-foo": "bar" } it's not valid in ruby haml compiler

That's right, but this is haml.js and not ruby haml :)

On Mon, May 26, 2014 at 4:52 PM, markson notifications@github.com wrote:

@saschagehlich https://github.com/saschagehlich I think { "data-foo":
"bar" } it's not valid in ruby haml compiler


Reply to this email directly or view it on GitHubhttps://github.com//issues/66#issuecomment-44195662
.

Mit freundlichen Grüßen,
Sascha Gehlich
Founder & CEO

Mobil: +49 (0)151 4190 2765
Mail: sascha@gehlich.us
Web: http://www.filshmedia.net

FILSH Media GmbH
Kortumstraße 26
44787 Bochum
Germany

Firmensitz: Bochum
Amtsgericht Bochum, HRB 14141
Geschäftsführung: Sascha Gehlich

And actually, with ruby 1.9 this syntax should work as well

@saschagehlich you're right ruby 1.9 support comma syntax, but for some reason haml doesn't allow 'data-foo':'bar', it only allow the key to be a symbol, :'data-foo' => 'bar' is only work around for ruby haml. But for now I can use your solution, thank you