Skip to content
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

Falsey values are not merged in data #42

Closed
k0kubun opened this issue Nov 28, 2015 · 2 comments
Closed

Falsey values are not merged in data #42

k0kubun opened this issue Nov 28, 2015 · 2 comments

Comments

@k0kubun
Copy link
Contributor

k0kubun commented Nov 28, 2015

$ cat in.haml 
- h1 = { new: true }
- h2 = { data: { old: true } }
%a(data=h1){ h2 , data: { new: nil, old: false } }

$ haml in.haml
<a></a>

$ faml render in.haml
<a data-new data-old></a>
@eagletmt
Copy link
Owner

It isn't specific to data attributes...

- h1 = { foo: 'should be overwritten' }
- h2 = { foo: nil }
%a{h1, h2}
% haml in.haml
<a></a>
% faml render in.haml
<a foo='should be overwritten'></a>

I have to exclude falsey values after merging all attributes.

@k0kubun
Copy link
Contributor Author

k0kubun commented Nov 28, 2015

It isn't specific to data attributes...

😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants