WP_HTML_Processor::generate_implied_end_tags_thoroughly
Closes elements that have implied end tags, thoroughly.
See the HTML specification for an explanation why this is different from generating end tags in the normal sense.
Method of the class: WP_HTML_Processor{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->generate_implied_end_tags_thoroughly(): void;
Notes
- See: WP_HTML_Processor::generate_implied_end_tags
- See: https://html.spec.whatwg.org/#generate-implied-end-tags
Changelog
| Since 6.4.0 | Introduced. |
| Since 6.7.0 | Full spec support. |
WP_HTML_Processor::generate_implied_end_tags_thoroughly() WP HTML Processor::generate implied end tags thoroughly code WP 6.8.3
private function generate_implied_end_tags_thoroughly(): void {
$elements_with_implied_end_tags = array(
'CAPTION',
'COLGROUP',
'DD',
'DT',
'LI',
'OPTGROUP',
'OPTION',
'P',
'RB',
'RP',
'RT',
'RTC',
'TBODY',
'TD',
'TFOOT',
'TH',
'THEAD',
'TR',
);
while ( in_array( $this->state->stack_of_open_elements->current_node()->node_name, $elements_with_implied_end_tags, true ) ) {
$this->state->stack_of_open_elements->pop();
}
}