Project

General

Profile

Backport #4497

REXML Pretty formater does use specified 'width' to wrap lines

Added by mfrasca (Michael Frasca) over 8 years ago. Updated 7 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:<unknown>]

Description

=begin
REXML::Formatters::Pretty has 'width' attribute used to wrap lines. This is not used when the wrap method is invoked

# pretty.rb - line 86
def write_text( node, output )
s = node.to_s()
s.gsub!(/\s/,' ')
s.squeeze!(" ")
s = wrap(s, 80-@level) ## HERE - 80 is hard coded, value should depend on @width and @level (e.g. @width - @level)
s = indent_text(s, @level, " ", true)
output << (' '*@level + s)
end
=end


Files

ruby-core-bug-4497.patch (465 Bytes) ruby-core-bug-4497.patch PATCH - Bug 4497 mfrasca (Michael Frasca), 03/14/2011 03:03 AM

History

#1

Updated by mfrasca (Michael Frasca) over 8 years ago

=begin
Patch attached for 'lib/rexml/formatters/pretty.rb'. @width attribute is used to compute line width when wrapping text output. @level is subtracted from @width to account for indenting of current xml node.

-Michael Frasca

=end

#2

Updated by jeremyevans0 (Jeremy Evans) 7 days ago

  • ruby -v deleted (ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32])
  • Target version deleted (Ruby 1.8.7)
  • Status changed from Open to Closed
  • Description updated (diff)
  • Project changed from Ruby 1.8 to Backport187
  • Tracker changed from Bug to Backport

Also available in: Atom PDF