diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-07 14:14:46 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-07 14:14:46 +0000 |
commit | daed03f7ecb2623d47fe4a2842d0325ac507dd78 (patch) | |
tree | 4d6f1db69533d7d1d1ad99c9c0dbe4ffb55cab16 /lib/rexml/element.rb | |
parent | 6740e1ff5c0f53bf43e2eeb768798e571a551d94 (diff) |
REXML CHANGES
The previous bug fixing the behavior of Element::text= introduced a bug that
occurred when calling (el.text = nil) to delete the first text node.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/element.rb')
-rw-r--r-- | lib/rexml/element.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index d616d0311f..aba57d708c 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -429,7 +429,7 @@ module REXML element = @elements[ path ] rv = element.get_text unless element.nil? else - rv = find { |node| node.kind_of? Text } + rv = @children.find { |node| node.kind_of? Text } end return rv end @@ -457,8 +457,8 @@ module REXML def text=( text ) if text.kind_of? String text = Text.new( text, whitespace(), nil, raw() ) - else - text = Text.new( text.to_s, whitespace(), nil, raw() ) unless text.kind_of? Text + elsif text and !text.kind_of? Text + text = Text.new( text.to_s, whitespace(), nil, raw() ) end old_text = get_text |