WP_HTML_Active_Formatting_Elements::clear_up_to_last_marker
Clears the list of active formatting elements up to the last marker.
When the steps below require the UA to clear the list of active formatting elements up to > the last marker, the UA must perform the following steps: > > 1. Let entry be the last (most recently added) entry in the list of active > formatting elements. > 2. Remove entry from the list of active formatting elements. > 3. If entry was a marker, then stop the algorithm at this point. > The list has been cleared up to the last marker. > 4. Go to step 1.
Method of the class: WP_HTML_Active_Formatting_Elements{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_HTML_Active_Formatting_Elements = new WP_HTML_Active_Formatting_Elements(); $WP_HTML_Active_Formatting_Elements->clear_up_to_last_marker(): void;
Notes
Changelog
| Since 6.7.0 | Introduced. |
WP_HTML_Active_Formatting_Elements::clear_up_to_last_marker() WP HTML Active Formatting Elements::clear up to last marker code WP 6.9.1
public function clear_up_to_last_marker(): void {
foreach ( $this->walk_up() as $item ) {
array_pop( $this->stack );
if ( 'marker' === $item->node_name ) {
break;
}
}
}