WP_HTML_Processor::close_cell()

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Runs the “close the cell” algorithm.

Description

Where the steps above say to close the cell, they mean to run the following algorithm:

  1. Generate implied end tags.
  2. If the current node is not now a td element or a th element, then this is a parse error.
  3. Pop elements from the stack of open elements stack until a td element or a th element has been popped from the stack.
  4. Clear the list of active formatting elements up to the last marker.
  5. Switch the insertion mode to “in row”.

See also

Source

}

// > If there is no such element, then return and instead act as described in the "any other end tag" entry above.
if ( null === $formatting_element ) {
	$this->bail( 'Cannot run adoption agency when "any other end tag" is required.' );
}

// > If formatting element is not in the stack of open elements, then this is a parse error; remove the element from the list, and return.
if ( ! $this->state->stack_of_open_elements->contains_node( $formatting_element ) ) {
	$this->state->active_formatting_elements->remove_node( $formatting_element );
	return;
}

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.