def _remove_noon_off_on_italics(collection):
    """Removes pairs of off-on italics nodes, that don't surround any other
    node

    :type collection: list[_InstructionNode]
    :return: list[_InstructionNode]
    """
    new_collection = []
    to_commit = None
    for node in collection:
        if node.is_italics_node() and node.sets_italics_off():
            to_commit = node
            continue
        elif node.is_italics_node() and node.sets_italics_on():
            if to_commit:
                to_commit = None
                continue
        elif to_commit:
            new_collection.append(to_commit)
            to_commit = None
        new_collection.append(node)
    if to_commit:
        new_collection.append(to_commit)
    return new_collection
