WP_HTML_Processor::reconstruct_active_formatting_elements(): bool

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.

Reconstructs the active formatting elements.

Description

This has the effect of reopening all the formatting elements that were opened in the current body, cell, or caption (whichever is youngest) that haven’t been explicitly closed.

See also

Return

bool Whether any formatting elements needed to be reconstructed.

Source

 *
 * @see https://html.spec.whatwg.org/#adjusted-current-node
 *
 * @since 6.7.0
 * @ignore
 *
 * @return WP_HTML_Token|null The adjusted current node.
 */
private function get_adjusted_current_node(): ?WP_HTML_Token {
	if ( isset( $this->context_node ) && 1 === $this->state->stack_of_open_elements->count() ) {
		return $this->context_node;
	}

	return $this->state->stack_of_open_elements->current_node();
}

/**
 * Reconstructs the active formatting elements.
 *
 * > This has the effect of reopening all the formatting elements that were opened
 * > in the current body, cell, or caption (whichever is youngest) that haven't
 * > been explicitly closed.
 *
 * @since 6.4.0
 * @ignore
 *
 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
 *
 * @see https://html.spec.whatwg.org/#reconstruct-the-active-formatting-elements
 *

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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