lib/gumbo/extra.rb in ruby-gumbo-1.0.1 vs lib/gumbo/extra.rb in ruby-gumbo-1.0.2
- old
+ new
@@ -24,12 +24,14 @@
return unless node.type == :document || node.type == :element
output.write (" " * indent)
if node.type == :element
- tag = (node.tag == :unknown) ? node.original_tag : node.tag.to_s
+ tag = (node.tag == :unknown) ? node.original_tag_name : node.tag.to_s
attributes = node.attributes.map(&:name)
- output.puts "<" + tag.upcase() + " " + attributes.join(" ") + ">"
+ output.write "<" + tag.upcase()
+ output.write(" " + attributes.join(" ")) unless attributes.empty?
+ output.puts ">"
indent += 2
end
for child in node.children