# File TagTreeScanner.rb, line 472 def remove_child( existing_child ) idx = @child_tags.index( existing_child ) raise "#{existing_child.inspect} is not a child of #{self.inspect}" unless idx prev, succ = existing_child.previous_sibling, existing_child.next_sibling prev.next_sibling = succ if prev succ.previous_sibling = prev if succ @child_tags.delete_at( idx ) existing_child.previous_sibling = existing_child.next_sibling = existing_child.parent_tag = nil existing_child end