mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Cross-ported the REXML changes (3.0.8) from the development branch to the
stable branch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
db0fac0266
commit
abe1214b3d
12 changed files with 946 additions and 891 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue