class JytPay::Xml::MyPrecious

fix bug in REXML::Formatters::Pretty

Public Instance Methods

write_text( node, output ) click to toggle source
# File lib/jyt_pay/xml/xml.rb, line 26
def write_text( node, output )
  s = node.to_s()
  s.gsub!(/\s/,' ')
  s.squeeze!(" ")

  #The Pretty formatter code mistakenly used 80 instead of the @width variable
  s = wrap(s, @width-@level)

  s = indent_text(s, @level, " ", true)
  output << (' '*@level + s)
end