From 7e168983ce133427289d53d159a1e354abb4e92e Mon Sep 17 00:00:00 2001 From: ser Date: Sat, 28 Jul 2007 13:28:30 +0000 Subject: Fixes a bug in the pretty printer related to an incomplete refactoring. Merge code cleanups Fixes another bug related to the formatting code refactoring in 3.1.7 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/formatters/pretty.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/rexml/formatters/pretty.rb') diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb index 78eab27402..22b6d857cd 100644 --- a/lib/rexml/formatters/pretty.rb +++ b/lib/rexml/formatters/pretty.rb @@ -57,8 +57,11 @@ module REXML if compact if node.children.inject(true) {|s,c| s & c.kind_of?(Text)} string = "" - node.children.each { |child| write( child, string, 0 ) } - if string.length + @level < @width + old_level = @level + @level = 0 + node.children.each { |child| write( child, string ) } + @level = old_level + if string.length < @width output << string skip = true end -- cgit v1.2.3