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

suppressempty does not suppress empty nodes if parent has attributes #26

Open
yaauie opened this issue May 28, 2019 · 0 comments
Open

Comments

@yaauie
Copy link

yaauie commented May 28, 2019

If we are iterating over the children of an element, the suppressempty option should do so if the child has no attributes.

       element.each_element { |child|
         value = collapse(child)
-         if empty(value) && (element.attributes.empty? || @options['noattr'])
+         if empty(value) && (child.attributes.empty? || @options['noattr'])
           next if @options.has_key?('suppressempty') && @options['suppressempty'] == true
         end
         result = merge(result, child.name, value)
       }
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

1 participant