Project

General

Profile

Bug #342 ยป rexml_formatters_pretty_fix.patch

Anonymous, 07/22/2008 09:08 PM

View differences:

lib/rexml/formatters/pretty.rb (working copy)
def wrap(string, width)
# Recursively wrap string at width.
return string if string.length <= width
place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
place = string.rindex(' ', width) || width # Position in string with last ' ' before cutoff
return string[0,place] + "\n" + wrap(string[place+1..-1], width)
end
    (1-1/1)