* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):

abandon wrapping if the line contains no space.  [ruby-dev:36045]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-09-23 11:09:39 +00:00
parent 6b90013d1e
commit 83abcf5a2c
2 changed files with 6 additions and 0 deletions

View file

@ -129,6 +129,7 @@ module REXML
# Recursively wrap string at width.
return string if string.length <= width
place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
return string if place.nil?
return string[0,place] + "\n" + wrap(string[place+1..-1], width)
end