Returns the adjusted current node.
Description
The adjusted current node is the context element if the parser was created as part of the HTML fragment parsing algorithm and the stack of open elements has only one element in it (fragment case); otherwise, the adjusted current node is the current node.
See also
Source
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();
}
Changelog
| Version | Description |
|---|---|
| 6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.