# File TagTreeScanner.rb, line 494 def replace_child( old_child, new_child ) if ( prev = old_child.previous_sibling ) == new_child || old_child.next_sibling == new_child remove_child( old_child ) else new_child.parent_tag.remove_child( new_child ) if new_child.parent_tag remove_child( old_child ) insert_after( new_child, prev ) end old_child end