Skip to content

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

@yaauie

Description

@yaauie

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)
       }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions