# File TagTreeScanner.rb, line 513 def replace_with( new_child ) return new_child if new_child == self raise "#{self.inspect} is not a child of another tag" unless @parent_tag @parent_tag.replace_child( self, new_child ) new_child end