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

TagNode#hash_attributes? and #hash_attributes_source fail for multiline hash attributes #49

Closed
seanwalbran opened this issue Dec 9, 2014 · 0 comments
Labels

Comments

@seanwalbran
Copy link

With a tag definition with hash attributes spanning multiple lines, TagNode#hash_attributes? incorrectly returns false, and TagNode#hash_attributes_source incorrectly returns nil.

Haml source:

      %tag{ one: 1,
            two: 2,
            three: 3 }

Observed behavior:

(byebug) node.first_line_source
"%tag{ one: 1,"
(byebug) node.hash_attributes?
false
(byebug) node.hash_attributes_source
nil
(byebug) node.dynamic_attributes_source
{:hash=>nil}

Expected behavior (shown via a single-line tag definition):

(byebug) node.first_line_source
"%tag{ one: 1, two: 2, three: 3}"
(byebug) node.hash_attributes?
true
(byebug) node.hash_attributes_source
"{ one: 1, two: 2, three: 3}"
(byebug) node.dynamic_attributes_source
{:hash=>"{ one: 1, two: 2, three: 3}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants