Remove all nodes when calling Element#inner_text=

This fixes #64.
This commit is contained in:
Yorick Peterse committed 2014-12-14 23:32:43 +01:00
1 parent 739f885078
commit 746c8052dd
3 files changed
+16 -7

No files matched your search

+2 -5
View File
@@ -212,11 +212,8 @@ module Oga
# @param [String] text
#
def inner_text=(text)
children.each do |child|
child.remove if child.is_a?(Text)
end
children << XML::Text.new(:text => text)
text_node = XML::Text.new(:text => text)
@children = NodeSet.new([text_node])
end
##