1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

------------------------------------------------------------------------

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ser 2004-05-16 18:42:58 +00:00
parent fcc9c6eab3
commit 0d04057aad
4 changed files with 6 additions and 6 deletions

View file

@ -59,7 +59,7 @@ module REXML
# c = CData.new( " Some text " )
# c.write( $stdout ) #-> <![CDATA[ Some text ]]>
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
indent( output, indent )
indent( output, indent ) unless transitive
output << START
output << @string
output << STOP

View file

@ -659,7 +659,7 @@ module REXML
end
writer << "/"
else
if transitive and indent>-1 and !@children[0].kind_of? Text
if transitive and indent>-1 and !@children[0].instance_of? Text
writer << "\n"
indent writer, indent+1
end

View file

@ -10,7 +10,7 @@
#
# Main page:: http://www.germane-software.com/software/rexml
# Author:: Sean Russell <serATgermaneHYPHENsoftwareDOTcom>
# Version:: 3.0.7
# Version:: 3.0.8
# Date:: +2004/137
#
# This API documentation can be downloaded from the REXML home page, or can
@ -22,5 +22,5 @@
module REXML
Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell <ser@germane-software.com>"
Date = "+2004/137"
Version = "3.0.7"
Version = "3.0.8"
end

View file

@ -194,7 +194,7 @@ module REXML
@raw = false
end
def indent(string, level=1, style="\t", indentfirstline=true)
def indent_text(string, level=1, style="\t", indentfirstline=true)
return string if level < 0
new_string = ''
string.each { |line|
@ -211,7 +211,7 @@ module REXML
if not (@parent and @parent.whitespace) then
s = wrap(s, 60, false) if @parent and @parent.context[:wordwrap] == :all
if @parent and not @parent.context[:indentstyle].nil? and indent > 0 and s.count("\n") > 0
s = indent(s, indent, @parent.context[:indentstyle], false)
s = indent_text(s, indent, @parent.context[:indentstyle], false)
end
s.squeeze!(" \n\t") if @parent and !@parent.whitespace
end