summaryrefslogtreecommitdiff
path: root/lib/rexml/element.rb
diff options
context:
space:
mode:
authorser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-07 14:14:46 +0000
committerser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-07 14:14:46 +0000
commit8586deca95eea4634ebb2cdc18487b0197d4b070 (patch)
treed745c27e6b912c7ad0649967da15658c10ee5d35 /lib/rexml/element.rb
parentdf84c64be98e362068524a2bbe7db6bcefe2ca7c (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/trunk@6121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/element.rb')
-rw-r--r--lib/rexml/element.rb6
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