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

Bug of parse_old_attributes #7

Closed
creasty opened this issue Mar 31, 2015 · 2 comments
Closed

Bug of parse_old_attributes #7

creasty opened this issue Mar 31, 2015 · 2 comments

Comments

@creasty
Copy link
Contributor

creasty commented Mar 31, 2015

Hi, thanks for your great work, I'm seriously considering replacing haml-rails with hamlit in my project, but I'm in trouble with a bug of parse_old_attributes.

Reproducible ways

Accepted and correct

parse_old_attributes '{ data: { value: "#{I18n.t "foo"}"}}'
#=> {"data"=>{"value"=>"\"\#{I18n.t \"foo\"}\""}}

Accepted but incorrect

parse_old_attributes '{ value: "#{I18n.t "foo", count: 1}" }'
#=> {"value"=>"\"\#{I18n.t \"foo\", count: 1", "{"=>"\""}

parse_old_attributes '{ data: { value: "#{I18n.t "foo", count: 1}" } }'
#=> {"data"=>{"value"=>"\"\#{I18n.t \"foo\", count: 1", "{"=>"\""}}

Rejected

Watch braces at the end of buffer

parse_old_attributes '{ data: { value: "#{I18n.t "foo", count: 1}"}}'
# raises #<Hamlit::SyntaxError: Hamlit::SyntaxError>
@k0kubun
Copy link
Owner

k0kubun commented Mar 31, 2015

Thank you for your attention to this project and I fixed the issue in ff53e5a.
Released as v0.3.2 💎

@creasty
Copy link
Contributor Author

creasty commented Mar 31, 2015

Thank you for your fast response!

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